summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--preproc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/preproc.c b/preproc.c
index 19de89e9..af466637 100644
--- a/preproc.c
+++ b/preproc.c
@@ -907,10 +907,14 @@ static Token *tokenize(char *line)
type = TOK_PREPROC_ID;
} else if (*p == '{') {
p++;
- while (*p && *p != '}') {
+ while (*p) {
+ if (*p == '}')
+ break;
p[-1] = *p;
p++;
}
+ if (*p != '}')
+ error(ERR_WARNING | ERR_PASS1, "unterminated %{ construct");
p[-1] = '\0';
if (*p)
p++;