summaryrefslogtreecommitdiffstats
path: root/lib/printf.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-06-17 16:34:13 +0200
committerMartin Mares <mj@ucw.cz>1998-06-17 16:34:13 +0200
commitd997534f65903e8078efe2f8ceb19941692598f7 (patch)
tree1ae35395db62ed44ceb27a1c2296c8f791e5d091 /lib/printf.c
parent9556f225853748d5fee9a21e179b8fd5da2d3c42 (diff)
downloadbird-d997534f65903e8078efe2f8ceb19941692598f7.tar
bird-d997534f65903e8078efe2f8ceb19941692598f7.zip
Oops, forgot '%m'...
Diffstat (limited to 'lib/printf.c')
-rw-r--r--lib/printf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/printf.c b/lib/printf.c
index dc9ea1b..21453dd 100644
--- a/lib/printf.c
+++ b/lib/printf.c
@@ -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;