summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4f4a330)
raw | patch | inline | side by side (parent: 4f4a330)
author | Florian Forster <octo@verplant.org> | |
Fri, 10 Sep 2010 09:26:38 +0000 (11:26 +0200) | ||
committer | Florian Forster <octo@verplant.org> | |
Fri, 10 Sep 2010 09:26:38 +0000 (11:26 +0200) |
src/graph.c | patch | blob | history |
diff --git a/src/graph.c b/src/graph.c
index fdbf71357fd91c274e9a5c883b1cfc8dd996d431..deeb05a649aa50a11bec580acde42b63c11e8e1e 100644 (file)
--- a/src/graph.c
+++ b/src/graph.c
yajl_gen_string_cast (handler, "select", strlen ("select"));
ident_to_json (cfg->select, handler);
- yajl_gen_string_cast (handler, "title", strlen ("title"));
- yajl_gen_string_cast (handler, cfg->title, strlen (cfg->title));
- yajl_gen_string_cast (handler, "vertical_label", strlen ("vertical_label"));
- yajl_gen_string_cast (handler, cfg->vertical_label, strlen (cfg->vertical_label));
+ if (cfg->title != NULL)
+ {
+ yajl_gen_string_cast (handler, "title", strlen ("title"));
+ yajl_gen_string_cast (handler, cfg->title, strlen (cfg->title));
+ }
+ if (cfg->vertical_label != NULL)
+ {
+ yajl_gen_string_cast (handler, "vertical_label", strlen ("vertical_label"));
+ yajl_gen_string_cast (handler, cfg->vertical_label, strlen (cfg->vertical_label));
+ }
yajl_gen_string_cast (handler, "show_zero", strlen ("show_zero"));
yajl_gen_bool (handler, cfg->show_zero);