parsing: ban strncpy()

Git upstream bans strncpy() with commit:

  banned.h: mark strncpy() as banned
  e488b7aba743d23b830d239dcc33d9ca0745a9ad

Signed-off-by: Christian Hesse <mail@eworm.de>
Esse commit está contido em:
Christian Hesse 2018-08-28 18:11:50 +02:00
commit 7cde5885d8
1 arquivos alterados com 1 adições e 2 exclusões

Ver arquivo

@ -63,8 +63,7 @@ static char *substr(const char *head, const char *tail)
if (tail < head)
return xstrdup("");
buf = xmalloc(tail - head + 1);
strncpy(buf, head, tail - head);
buf[tail - head] = '\0';
strlcpy(buf, head, tail - head + 1);
return buf;
}