From 0fa6258e4ac45162a52a0531a86a70ff0b00f1a6 Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Thu, 27 Apr 2006 10:07:07 +0200 Subject: [PATCH] conf2: dumping of NULL strings polished --- lib/conf2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/conf2.c b/lib/conf2.c index 46498c99..66b9bfe7 100644 --- a/lib/conf2.c +++ b/lib/conf2.c @@ -1433,7 +1433,12 @@ dump_basic(struct fastbuf *fb, void *ptr, enum cf_type type, union cf_union *u) case CT_U64: bprintf(fb, "%llu ", *(u64*)ptr); break; case CT_DOUBLE: bprintf(fb, "%lg ", *(double*)ptr); break; case CT_IP: bprintf(fb, "%08x ", *(uns*)ptr); break; - case CT_STRING: bprintf(fb, "'%s' ", *(byte**)ptr); break; + case CT_STRING: + if (*(byte**)ptr) + bprintf(fb, "'%s' ", *(byte**)ptr); + else + bprintf(fb, "NULL "); + break; case CT_LOOKUP: bprintf(fb, "%s ", *(int*)ptr >= 0 ? u->lookup[ *(int*)ptr ] : (byte*) "???"); break; case CT_USER: if (u->utype->dumper) -- 2.39.2