mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
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>
This commit is contained in:
parent
fbcad20072
commit
fe882ea58e
1 changed files with 1 additions and 1 deletions
|
@ -266,7 +266,7 @@ static char *next_segment(char *buf, int *offset, int size)
|
||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
if (i < size) {
|
if (i < size) {
|
||||||
if (buf[i] == '\\' && i < size - 1 &&
|
if (i < size - 1 && buf[i] == '\\' &&
|
||||||
(buf[i+1] == '\\' || buf[i+1] == '{'))
|
(buf[i+1] == '\\' || buf[i+1] == '{'))
|
||||||
memcpy(buf + i, buf + i + 1, size - i - 1);
|
memcpy(buf + i, buf + i + 1, size - i - 1);
|
||||||
else if (buf[i] == '{')
|
else if (buf[i] == '{')
|
||||||
|
|
Loading…
Add table
Reference in a new issue