Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / net / pppd / patches / patch-bc
blob7814779a4eb90e073f474fd34183f8e439ff5d4e
1 $NetBSD$
3 --- pppd/utils.c.orig   2004-11-04 11:02:26.000000000 +0100
4 +++ pppd/utils.c
5 @@ -41,7 +41,6 @@
6  #include <syslog.h>
7  #include <netdb.h>
8  #include <time.h>
9 -#include <utmp.h>
10  #include <pwd.h>
11  #include <sys/param.h>
12  #include <sys/types.h>
13 @@ -76,6 +75,7 @@ struct buffer_info {
14      int len;
15  };
17 +#ifndef HAS_STRLFUNCS
18  /*
19   * strlcpy - like strcpy/strncpy, doesn't overflow destination buffer,
20   * always leaves destination null-terminated (for len > 0).
21 @@ -113,6 +113,7 @@ strlcat(dest, src, len)
23      return dlen + strlcpy(dest + dlen, src, (len > dlen? len - dlen: 0));
24  }
25 +#endif
28  /*
29 @@ -197,7 +198,7 @@ vslprintf(buf, buflen, fmt, args)
30             width = va_arg(args, int);
31             c = *++fmt;
32         } else {
33 -           while (isdigit(c)) {
34 +           while (isdigit((unsigned char)c)) {
35                 width = width * 10 + c - '0';
36                 c = *++fmt;
37             }
38 @@ -209,7 +210,7 @@ vslprintf(buf, buflen, fmt, args)
39                 c = *++fmt;
40             } else {
41                 prec = 0;
42 -               while (isdigit(c)) {
43 +               while (isdigit((unsigned char)c)) {
44                     prec = prec * 10 + c - '0';
45                     c = *++fmt;
46                 }
47 @@ -287,19 +288,15 @@ vslprintf(buf, buflen, fmt, args)
48                      (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff);
49             str = num;
50             break;
51 -#if 0  /* not used, and breaks on S/390, apparently */
52 -       case 'r':
53 +       case 'r': {
54 +           va_list vlist;
55             f = va_arg(args, char *);
56 -#ifndef __powerpc__
57 -           n = vslprintf(buf, buflen + 1, f, va_arg(args, va_list));
58 -#else
59 -           /* On the powerpc, a va_list is an array of 1 structure */
60 -           n = vslprintf(buf, buflen + 1, f, va_arg(args, void *));
61 -#endif
62 +           vlist = va_arg(args, va_list);
63 +           n = vslprintf(buf, buflen + 1, f, vlist);
64             buf += n;
65             buflen -= n;
66             continue;
67 -#endif
68 +       }
69         case 't':
70             time(&t);
71             str = ctime(&t);