From: Martin Mares Date: Wed, 17 Jun 1998 14:34:13 +0000 (+0000) Subject: Oops, forgot '%m'... X-Git-Tag: v1.2.0~1865 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d997534f65903e8078efe2f8ceb19941692598f7;p=thirdparty%2Fbird.git Oops, forgot '%m'... --- diff --git a/lib/printf.c b/lib/printf.c index dc9ea1b3c..21453ddcb 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -9,6 +9,9 @@ #include "nest/bird.h" #include "string.h" +#include +#include + /* we use this so that we can do without the ctype library */ #define is_digit(c) ((c) >= '0' && (c) <= '9') @@ -184,11 +187,15 @@ int bvsprintf(char *buf, const char *fmt, va_list args) *str++ = ' '; continue; + case 'm': + s = strerror(errno); + goto str; case 's': s = va_arg(args, char *); if (!s) s = ""; + str: len = strlen(s); if (precision >= 0 && len > precision) len = precision;