summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--preproc.c2
-rw-r--r--test/strlen.asm5
2 files changed, 6 insertions, 1 deletions
diff --git a/preproc.c b/preproc.c
index 7fc3e74..d75b58e 100644
--- a/preproc.c
+++ b/preproc.c
@@ -3254,7 +3254,7 @@ issue_error:
while (tok_type_(t, TOK_WHITESPACE))
t = t->next;
/* t should now point to the string */
- if (t->type != TOK_STRING) {
+ if (!tok_type_(t, TOK_STRING)) {
error(ERR_NONFATAL,
"`%%strlen` requires string as second parameter");
free_tlist(tline);
diff --git a/test/strlen.asm b/test/strlen.asm
new file mode 100644
index 0000000..913014c
--- /dev/null
+++ b/test/strlen.asm
@@ -0,0 +1,5 @@
+%macro strlen_test 1
+ %strlen len %2 ; not existing argument
+%endmacro
+
+strlen_test 'a'