pkgsrc/net/pppd/patches/patch-bc
cube 3e86158156 Initial import of pppd, version 2.4.3, into the NetBSD Package Collection.
The PPP Daemon is the userland part of the Point-to-Point Protocol.  It works
in combination with a dedicated kernel network interface usually named ppp.
PPP is a very extensible protocol and pppd supports a large number of options,
including compression (through various algorithms), cryptography (Microsoft's
MPPE) and authentication (PAP, CHAP, Microsoft CHAP), provided the kernel has
the relevant back-ends in some cases.
2005-01-02 02:51:40 +00:00

71 lines
1.8 KiB
Text

$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 <syslog.h>
#include <netdb.h>
#include <time.h>
-#include <utmp.h>
#include <pwd.h>
#include <sys/param.h>
#include <sys/types.h>
@@ -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);