Oops, forgot '%m'...
This commit is contained in:
parent
9556f22585
commit
d997534f65
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue