summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2019-11-28 21:18:38 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2019-11-28 22:23:40 +0000
commitad98fad9a3130b60ee2eba5312506ef531500117 (patch)
tree330933a2793692f44d0a2286c082db04a8b210b6
parent640149337f54cc298cc7ff2e296545af04aed3bf (diff)
Do not crash when a format doesn't exist, reported by Thomas Sattler.
-rw-r--r--format.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/format.c b/format.c
index 6d85f3fc..7da6c802 100644
--- a/format.c
+++ b/format.c
@@ -1104,11 +1104,10 @@ format_find(struct format_tree *ft, const char *key, int modifiers)
xasprintf(&found, "%lld", (long long)fe->t);
goto found;
}
- if (fe->value == NULL && fe->cb != NULL) {
+ if (fe->value == NULL && fe->cb != NULL)
fe->cb(ft, fe);
- if (fe->value == NULL)
- fe->value = xstrdup("");
- }
+ if (fe->value == NULL)
+ fe->value = xstrdup("");
found = xstrdup(fe->value);
goto found;
}