Oops, forgot '%m'...

This commit is contained in:
Martin Mares 1998-06-17 14:34:13 +00:00
parent 9556f22585
commit d997534f65

View file

@ -9,6 +9,9 @@
#include "nest/bird.h" #include "nest/bird.h"
#include "string.h" #include "string.h"
#include <errno.h>
#include <string.h>
/* we use this so that we can do without the ctype library */ /* we use this so that we can do without the ctype library */
#define is_digit(c) ((c) >= '0' && (c) <= '9') #define is_digit(c) ((c) >= '0' && (c) <= '9')
@ -184,11 +187,15 @@ int bvsprintf(char *buf, const char *fmt, va_list args)
*str++ = ' '; *str++ = ' ';
continue; continue;
case 'm':
s = strerror(errno);
goto str;
case 's': case 's':
s = va_arg(args, char *); s = va_arg(args, char *);
if (!s) if (!s)
s = "<NULL>"; s = "<NULL>";
str:
len = strlen(s); len = strlen(s);
if (precision >= 0 && len > precision) if (precision >= 0 && len > precision)
len = precision; len = precision;