aboutsummaryrefslogtreecommitdiffhomepage
path: root/c/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/lex.c')
-rw-r--r--c/lex.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/c/lex.c b/c/lex.c
index 07b5cb0..6099539 100644
--- a/c/lex.c
+++ b/c/lex.c
@@ -2175,7 +2175,11 @@ cpppredef(bool undef, const char *cmd)
char line[1024];
struct wbuf wbuf = MEMBUF(line, sizeof line);
if (!ppcmdline.p) vinit(&ppcmdline, NULL, 1<<10);
- int n = bfmt(&wbuf, "%s %S %s\n", undef ? "#undef" : "#define", cmd, namelen, body);
+ int n;
+ if (undef)
+ n = bfmt(&wbuf, "#undef %S\n", cmd, namelen);
+ else
+ n = bfmt(&wbuf, "#define %S %s\n", cmd, namelen, body);
assert(n <= sizeof line);
vpushn(&ppcmdline, line, n);
}