$NetBSD: patch-bc,v 1.1.1.1 2005/01/02 02:51:44 cube Exp $ --- pppd/utils.c.orig 2004-11-04 11:02:26.000000000 +0100 +++ pppd/utils.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -76,6 +75,7 @@ struct buffer_info { int len; }; +#ifndef HAS_STRLFUNCS /* * strlcpy - like strcpy/strncpy, doesn't overflow destination buffer, * always leaves destination null-terminated (for len > 0). @@ -113,6 +113,7 @@ strlcat(dest, src, len) return dlen + strlcpy(dest + dlen, src, (len > dlen? len - dlen: 0)); } +#endif /* @@ -197,7 +198,7 @@ vslprintf(buf, buflen, fmt, args) width = va_arg(args, int); c = *++fmt; } else { - while (isdigit(c)) { + while (isdigit((unsigned char)c)) { width = width * 10 + c - '0'; c = *++fmt; } @@ -209,7 +210,7 @@ vslprintf(buf, buflen, fmt, args) c = *++fmt; } else { prec = 0; - while (isdigit(c)) { + while (isdigit((unsigned char)c)) { prec = prec * 10 + c - '0'; c = *++fmt; } @@ -287,19 +288,15 @@ vslprintf(buf, buflen, fmt, args) (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); str = num; break; -#if 0 /* not used, and breaks on S/390, apparently */ - case 'r': + case 'r': { + va_list vlist; f = va_arg(args, char *); -#ifndef __powerpc__ - n = vslprintf(buf, buflen + 1, f, va_arg(args, va_list)); -#else - /* On the powerpc, a va_list is an array of 1 structure */ - n = vslprintf(buf, buflen + 1, f, va_arg(args, void *)); -#endif + vlist = va_arg(args, va_list); + n = vslprintf(buf, buflen + 1, f, vlist); buf += n; buflen -= n; continue; -#endif + } case 't': time(&t); str = ctime(&t);