X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Futils.c;h=3ac1b60926d20014808dcaf708d59f6adb33ee1a;hb=ef8ec1132273c3dbff2387f117630bbeb3f23f8e;hp=eb771a540c118cad770548a64b9cadfa61f85211;hpb=c44ae5e6a7338c96eb463881fe709b2dfaffe568;p=ppp.git diff --git a/pppd/utils.c b/pppd/utils.c index eb771a5..3ac1b60 100644 --- a/pppd/utils.c +++ b/pppd/utils.c @@ -286,19 +286,6 @@ 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': - 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 - buf += n; - buflen -= n; - continue; -#endif case 't': time(&t); str = ctime(&t); @@ -309,6 +296,8 @@ vslprintf(buf, buflen, fmt, args) case 'q': /* quoted string */ quoted = c == 'q'; p = va_arg(args, unsigned char *); + if (p == NULL) + p = (unsigned char *)""; if (fillch == '0' && prec >= 0) { n = prec; } else { @@ -636,7 +625,7 @@ print_string(p, len, printer, arg) printer(arg, "\\t"); break; default: - printer(arg, "\\%.3o", c); + printer(arg, "\\%.3o", (unsigned char) c); } } }