X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/b0fc647fe61c19338aec65ffcab513cc84599b18..7cde5885d8ce53359ee665bb930b1da956e8369a:/parsing.c diff --git a/parsing.c b/parsing.c index 12453c2..e224564 100644 --- a/parsing.c +++ b/parsing.c @@ -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; }