aboutsummaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-11 15:26:49 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-11 16:29:58 +0100
commitfe882ea58ea847c7f5746759cd1cca3e862acdbe (patch)
tree88ee685a1f0ef275f3efc3a31be7cfc824f4efd8 /uemis-downloader.c
parentfbcad200723b36ee613df89775bf28f3503cfec0 (diff)
downloadsubsurface-fe882ea58ea847c7f5746759cd1cca3e862acdbe.tar.gz
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 <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c2
1 files changed, 1 insertions, 1 deletions
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] == '{')