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:
rwatson 2006-01-16 11:54:07 +00:00
parent 78d93723e6
commit 2ec0453929

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]);