Restore use of strncpy(), as there is later unconditional termination

of the string, and reliance on the returned pointer.

Found by:	bde (tm)
This commit is contained in:
Robert Watson 2006-01-16 11:54:07 +00:00
parent 2fd8d3d84e
commit d2042d2052
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154429

View File

@ -72,7 +72,7 @@ parse_lt(const char * str)
char buf[64];
/* Make local copy and force lowercase to simplify parsing */
p = strlcpy(buf, str, sizeof buf);
p = strncpy(buf, str, sizeof buf);
buf[sizeof buf - 1] = '\0';
for (i = 0; buf[i]; i++)
buf[i] = (char)tolower(buf[i]);