From a094d3bc42835b5c067d3a604300619a2facb5c2 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 29 Dec 2015 09:41:40 +0100 Subject: [PATCH] client: fix segfault when displaying some information Due to 5ed4156c02b0ba801feb9bf383d9b7772dc990e5, we were incorrectly hiding information when it was present and displaying it when it was absent (leading to a segfault). Closes #152 --- src/client/writer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/writer.h b/src/client/writer.h index 18737801..c664a14d 100644 --- a/src/client/writer.h +++ b/src/client/writer.h @@ -33,7 +33,7 @@ struct writer { #define tag_attr(w,...) w->attr(w,## __VA_ARGS__) #define tag_data(w,...) w->data(w,## __VA_ARGS__) #define tag_end(w,...) w->end(w,## __VA_ARGS__) -#define tag_datatag(w,t,d,v) do { if ((v) != NULL) break; w->start(w,t,d); w->data(w,v); w->end(w); } while(0); +#define tag_datatag(w,t,d,v) do { if ((v) == NULL) break; w->start(w,t,d); w->data(w,v); w->end(w); } while(0); extern struct writer * txt_init( FILE * ); extern struct writer * kv_init( FILE * ); -- 2.39.5