aboutsummaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2019-11-28 21:18:38 +0000
committernicm <nicm>2019-11-28 21:18:38 +0000
commitc5d74b1debc404340dd2049c708f9eb599be706e (patch)
tree4ba868dca507ba8edf016fae71fe8068e83b0a80 /format.c
parentfa409194d3dfe0095bf6572a253772f2825f5dec (diff)
downloadrtmux-c5d74b1debc404340dd2049c708f9eb599be706e.tar.gz
rtmux-c5d74b1debc404340dd2049c708f9eb599be706e.tar.bz2
rtmux-c5d74b1debc404340dd2049c708f9eb599be706e.zip
Do not crash when a format doesn't exist, reported by Thomas Sattler.
Diffstat (limited to 'format.c')
-rw-r--r--format.c7
1 files 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;
}