Replace strlcpy(3) with strncpy(3)

This commit is contained in:
styan 2020-06-20 11:26:48 +00:00
parent baf189b44c
commit 16a5bbc031
2 changed files with 3 additions and 3 deletions

View File

@ -154,7 +154,7 @@ main(int argc, char *argv[])
(void)memlcpy(mimestr, sizeof(mimestr),
gemini.meta + i, j - i);
else
(void)strlcpy(mimestr, "text/gemini",
(void)strncpy(mimestr, "text/gemini",
sizeof(mimestr));
for (tmime = mime; tmime != NULL &&
strcmp(tmime->target, mimestr) != 0;

View File

@ -227,8 +227,8 @@ gemini_connect(struct gemini *g, const char *url)
return (-1);
}
/* Proxy */
if (g->proxy != NULL && strlcpy(g->request, g->proxy,
sizeof(g->request)) >= sizeof(g->request)) {
if (g->proxy != NULL && strncpy(g->request, g->proxy,
sizeof(g->request)) >= g->request + sizeof(g->request)) {
errno = EINVAL;
return (-1);
}