In sbin/dhclient, since we know the size of the source strings anyway,

we might as well use memcpy; strlcpy is really unnecessary here.

MFC after:	1 week
This commit is contained in:
Dimitry Andric 2011-12-17 01:29:46 +00:00
parent e2f95dd941
commit 7824741286
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228615
2 changed files with 3 additions and 3 deletions

View File

@ -895,7 +895,7 @@ parse_string_list(FILE *cfile, struct string_list **lp, int multiple)
tmp = new_string_list(valsize);
if (tmp == NULL)
error("no memory for string list entry.");
strlcpy(tmp->string, val, valsize);
memcpy(tmp->string, val, valsize);
tmp->next = NULL;
/* Store this medium at the end of the media list. */

View File

@ -129,7 +129,7 @@ parse_string(FILE *cfile)
s = malloc(valsize);
if (!s)
error("no memory for string %s.", val);
strlcpy(s, val, valsize);
memcpy(s, val, valsize);
if (!parse_semi(cfile))
return (NULL);
@ -295,7 +295,7 @@ parse_numeric_aggregate(FILE *cfile, unsigned char *buf, int *max,
t = malloc(valsize);
if (!t)
error("no temp space for number.");
strlcpy(t, val, valsize);
memcpy(t, val, valsize);
c = cons(t, c);
}
} while (++count != *max);