]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Oops, forgot '%m'...
authorMartin Mares <mj@ucw.cz>
Wed, 17 Jun 1998 14:34:13 +0000 (14:34 +0000)
committerMartin Mares <mj@ucw.cz>
Wed, 17 Jun 1998 14:34:13 +0000 (14:34 +0000)
lib/printf.c

index dc9ea1b3c13d0c5496b413429db58e0e5a6db854..21453ddcb49c0ad507c10fb90fc6467b435f7662 100644 (file)
@@ -9,6 +9,9 @@
 #include "nest/bird.h"
 #include "string.h"
 
+#include <errno.h>
+#include <string.h>
+
 /* 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 = "<NULL>";
 
+               str:
                        len = strlen(s);
                        if (precision >= 0 && len > precision)
                                len = precision;