diff options
-rw-r--r-- | catsprintf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/catsprintf.c b/catsprintf.c index e914e6d..d9d73ff 100644 --- a/catsprintf.c +++ b/catsprintf.c @@ -1,3 +1,4 @@ +#include <stdio.h> #include "catsprintf.h" static const int map_maj[] = { @@ -65,7 +66,9 @@ dmi_minor* dmiAppendObject(long code, char const *key, const char *format, ...) o->id = code; o->major = (dmi_codes_major *)&dmiCodesMajor[map_maj[code>>8]]; o->key = (char *)key; - vsprintf(o->value, format, arg); + if (format != NULL) + vsprintf(o->value, format, arg); + o->next = last; va_end(arg); /* cleanup */ |