From c5d74b1debc404340dd2049c708f9eb599be706e Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 28 Nov 2019 21:18:38 +0000 Subject: [PATCH] Do not crash when a format doesn't exist, reported by Thomas Sattler. --- format.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/format.c b/format.c index 86878cda..e74de9c1 100644 --- a/format.c +++ b/format.c @@ -1112,11 +1112,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; }