summaryrefslogtreecommitdiff
path: root/net/pppd/patches/patch-bc
blob: 132e9c47ac2a33c2bae2d01c1c3425d88a8deba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
$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);