From 365a345e92c25c60c977aa1596e31a1e6b9cea80 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 12 Aug 2005 06:08:41 +0000 Subject: [PATCH] Backport 10864 and 10999. --- busybox/networking/inetd.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/busybox/networking/inetd.c b/busybox/networking/inetd.c index a1fa29ce4..c540a8578 100644 --- a/busybox/networking/inetd.c +++ b/busybox/networking/inetd.c @@ -447,7 +447,7 @@ static char *LastArg; static void setproctitle(char *a, int s) { - size_t size; + socklen_t size; char *cp; struct sockaddr_in sn; char buf[80]; @@ -1021,7 +1021,7 @@ static void echo_dg(int s, servtab_t *sep) { char buffer[BUFSIZE]; int i; - size_t size; + socklen_t size; struct sockaddr sa; (void)sep; @@ -1092,10 +1092,10 @@ static void chargen_stream(int s, servtab_t *sep) text[LINESIZ + 1] = '\n'; for (rs = ring;;) { if ((len = endring - rs) >= LINESIZ) - memcpy(rs, text, LINESIZ); + memcpy(text, rs, LINESIZ); else { - memcpy(rs, text, len); - memcpy(ring, text + len, LINESIZ - len); + memcpy(text, rs, len); + memcpy(text + len, ring, LINESIZ - len); } if (++rs == endring) rs = ring; @@ -1110,7 +1110,8 @@ static void chargen_dg(int s, servtab_t *sep) { struct sockaddr sa; static char *rs; - size_t len, size; + size_t len; + socklen_t size; char text[LINESIZ+2]; (void)sep; @@ -1125,10 +1126,10 @@ static void chargen_dg(int s, servtab_t *sep) return; if ((len = endring - rs) >= LINESIZ) - memcpy(rs, text, LINESIZ); + memcpy(text, rs, LINESIZ); else { - memcpy(rs, text, len); - memcpy(ring, text + len, LINESIZ - len); + memcpy(text, rs, len); + memcpy(text + len, ring, LINESIZ - len); } if (++rs == endring) rs = ring; @@ -1172,7 +1173,7 @@ static void machtime_dg(int s, servtab_t *sep) { long result; struct sockaddr sa; - size_t size; + socklen_t size; (void)sep; size = sizeof(sa); @@ -1208,7 +1209,7 @@ static void daytime_dg(int s, servtab_t *sep) { char buffer[256]; struct sockaddr sa; - size_t size; + socklen_t size; (void)sep; -- 2.25.1