diff options
author | nicm <nicm> | 2019-11-28 21:18:38 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2019-11-28 22:23:40 +0000 |
commit | ad98fad9a3130b60ee2eba5312506ef531500117 (patch) | |
tree | 330933a2793692f44d0a2286c082db04a8b210b6 | |
parent | 640149337f54cc298cc7ff2e296545af04aed3bf (diff) |
Do not crash when a format doesn't exist, reported by Thomas Sattler.
-rw-r--r-- | format.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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; } |