From fe882ea58ea847c7f5746759cd1cca3e862acdbe Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 11 Dec 2013 15:26:49 +0200 Subject: uiemis-downloader.c: fix preceding limit check next_segment(): The iterator limit check (i < size - 1) should precede the indexing (buf[i]). Reported by the program cppcheck. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- uemis-downloader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'uemis-downloader.c') diff --git a/uemis-downloader.c b/uemis-downloader.c index b1d977d41..2eaa18ca9 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -266,7 +266,7 @@ static char *next_segment(char *buf, int *offset, int size) while (!done) { if (i < size) { - if (buf[i] == '\\' && i < size - 1 && + if (i < size - 1 && buf[i] == '\\' && (buf[i+1] == '\\' || buf[i+1] == '{')) memcpy(buf + i, buf + i + 1, size - i - 1); else if (buf[i] == '{') -- cgit v1.2.3-70-g09d2