From 26bef5d20944d60b7bda1b1e6fc421e5d49e38b8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 31 Aug 2014 08:27:51 +0200 Subject: [PATCH] DecoderAPI: use std::min() --- src/decoder/DecoderAPI.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/decoder/DecoderAPI.cxx b/src/decoder/DecoderAPI.cxx index 4d0b2fd48..c3cbb3a21 100644 --- a/src/decoder/DecoderAPI.cxx +++ b/src/decoder/DecoderAPI.cxx @@ -519,9 +519,7 @@ decoder_data(Decoder &decoder, continue; } - size_t nbytes = dest.size; - if (nbytes > length) - nbytes = length; + const size_t nbytes = std::min(dest.size, length); /* copy the buffer */