mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 20:42:23 +00:00
Fix a bug and GCC warning introduced in 932669b
For unsigned types, the comparison >= 0 is always true, so avoid it by using a post-decrement and integrating the initial assigment into the loop body. No change in behavior is intended.
This commit is contained in:
parent
bac47f1ff8
commit
79a343968a
@ -553,10 +553,8 @@ static char *cfg_readline(diskfile_backend *cfg)
|
|||||||
|
|
||||||
memcpy(line, line_src, line_len);
|
memcpy(line, line_src, line_len);
|
||||||
|
|
||||||
line[line_len] = '\0';
|
do line[line_len] = '\0';
|
||||||
|
while (line_len-- > 0 && isspace(line[line_len]));
|
||||||
while (--line_len >= 0 && isspace(line[line_len]))
|
|
||||||
line[line_len] = '\0';
|
|
||||||
|
|
||||||
if (*line_end == '\n')
|
if (*line_end == '\n')
|
||||||
line_end++;
|
line_end++;
|
||||||
|
Loading…
Reference in New Issue
Block a user