summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2023-07-03 14:01:10 +0100
committerThomas Adam <thomas@xteddy.org>2023-07-03 14:01:10 +0100
commitf9b0460840b68ae2a569d7965d934ef733ebdf52 (patch)
treebe99d53909b1bf9b277c296e3d1a03ccf281014b
parent659d876cd57c345d653b12f02a75d383ce38eacb (diff)
parentac43186dff0f4e92a566987bb9108d6c5421e9ff (diff)
Merge branch 'obsd-master'
-rw-r--r--format.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/format.c b/format.c
index 13348803..af98a0aa 100644
--- a/format.c
+++ b/format.c
@@ -3664,7 +3664,9 @@ format_skip(const char *s, const char *end)
for (; *s != '\0'; s++) {
if (*s == '#' && s[1] == '{')
brackets++;
- if (*s == '#' && strchr(",#{}:", s[1]) != NULL) {
+ if (*s == '#' &&
+ s[1] != '\0' &&
+ strchr(",#{}:", s[1]) != NULL) {
s++;
continue;
}