mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 08:28:42 +00:00
ui-ssdiff: ban strncpy()
Git upstream bans strncpy() with commit: banned.h: mark strncpy() as banned e488b7aba743d23b830d239dcc33d9ca0745a9ad Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
parent
2fc008d6de
commit
0899eb644f
@ -103,8 +103,7 @@ static int line_from_hunk(char *line, char type)
|
|||||||
return 0;
|
return 0;
|
||||||
len = buf2 - buf1;
|
len = buf2 - buf1;
|
||||||
buf2 = xmalloc(len + 1);
|
buf2 = xmalloc(len + 1);
|
||||||
strncpy(buf2, buf1, len);
|
strlcpy(buf2, buf1, len + 1);
|
||||||
buf2[len] = '\0';
|
|
||||||
res = atoi(buf2);
|
res = atoi(buf2);
|
||||||
free(buf2);
|
free(buf2);
|
||||||
return res;
|
return res;
|
||||||
|
Loading…
Reference in New Issue
Block a user