summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-01-21 16:31:57 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-01-21 16:31:57 -0800
commitb4daadc0d8e7eb9f431ad78b4b9925d0d94eed57 (patch)
tree899809e737e63661579523c7a39b220691fb435a
parent216d074e9774b3010ba06f1fe1fa8f1175c42cdf (diff)
downloadnasm-b4daadc0d8e7eb9f431ad78b4b9925d0d94eed57.tar.gz
preproc.c: simplify detoken() slightly
Probably pointless optimization of detoken()...
-rw-r--r--preproc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/preproc.c b/preproc.c
index 8b2068f9..bfacb87f 100644
--- a/preproc.c
+++ b/preproc.c
@@ -987,6 +987,7 @@ static char *detoken(Token * tlist, int expand_locals)
Token *t;
int len;
char *line, *p;
+ const char *q;
len = 0;
for (t = tlist; t; t = t->next) {
@@ -1023,12 +1024,11 @@ static char *detoken(Token * tlist, int expand_locals)
p = line = nasm_malloc(len + 1);
for (t = tlist; t; t = t->next) {
if (t->type == TOK_WHITESPACE) {
- *p = ' ';
- p++;
- *p = '\0';
+ *p++ = ' ';
} else if (t->text) {
- strcpy(p, t->text);
- p += strlen(p);
+ q = t->text;
+ while (*q)
+ *p++ = *q++;
}
}
*p = '\0';