Replace strlcpy(3) with strncpy(3)
This commit is contained in:
parent
baf189b44c
commit
16a5bbc031
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue