summaryrefslogtreecommitdiffstats
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2019-03-13 14:27:17 +0000
committernicm <nicm>2019-03-13 14:27:17 +0000
commit49f04a997a578daff49e4c0b1ed32eb80e7aecfb (patch)
tree6ef67db60acd3adc6ff353770affdbbb6a2b04ef /format.c
parent9032ac2a05e0b769056a0d5a5814cc00ba065825 (diff)
Apply length limits and substitution even to literal formats.
Diffstat (limited to 'format.c')
-rw-r--r--format.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/format.c b/format.c
index 55cb5028..111d358b 100644
--- a/format.c
+++ b/format.c
@@ -1293,6 +1293,7 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
value = xstrdup("");
}
+done:
/* Expand again if required. */
if (modifiers & FORMAT_EXPAND) {
new = format_expand(ft, value);
@@ -1318,7 +1319,6 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
value = new;
}
-done:
/* Expand the buffer and copy in the value. */
valuelen = strlen(value);
while (*len - *off < valuelen + 1) {