Use strl* here too.

CID: 1383969
This commit is contained in:
Warner Losh 2017-12-27 20:33:37 +00:00
parent 3a7c4a1c83
commit f77a6187eb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327246

View File

@ -195,12 +195,12 @@ pnpval_as_str(const char *val, const char *pnpinfo)
cp = strchr(val, ';');
key[0] = ' ';
if (cp == NULL)
strcpy(key + 1, val);
strlcpy(key + 1, val, sizeof(key) - 1);
else {
memcpy(key + 1, val, cp - val);
key[cp - val + 1] = '\0';
}
strcat(key, "=");
strlcat(key, "=", sizeof(key));
if (strncmp(key + 1, pnpinfo, strlen(key + 1)) == 0)
quoted_strcpy(retval, pnpinfo + strlen(key + 1));
else {