Commit 24459e2e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

use snprintf() instead of strlcpy()

parent f4390be4
......@@ -52,9 +52,6 @@
#include <math.h>
#include "config.h"
#ifndef HAVE_STRLCPY
#include "compat/strlcpy.h"
#endif
#include "libvarnish.h"
......@@ -92,8 +89,8 @@ TCP_name(const struct sockaddr_storage *addr, unsigned l,
* for the gai_strerror in the bufffer :-(
*/
printf("getnameinfo = %d %s\n", i, gai_strerror(i));
strlcpy(abuf, "Conversion", alen);
strlcpy(pbuf, "Failed", plen);
snprintf(abuf, alen, "Conversion");
snprintf(pbuf, plen, "Failed");
return;
}
/* XXX dirty hack for v4-to-v6 mapped addresses */
......@@ -128,8 +125,8 @@ TCP_hisname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen)
if (!getpeername(sock, (void*)&addr_s, &l))
TCP_name(&addr_s, l, abuf, alen, pbuf, plen);
else {
strlcpy(abuf, "<none>", alen);
strlcpy(pbuf, "<none>", plen);
snprintf(abuf, alen, "<none>");
snprintf(pbuf, plen, "<none>");
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment