summaryrefslogtreecommitdiff
path: root/src/lib/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/module.c')
-rw-r--r--src/lib/module.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/module.c b/src/lib/module.c
index c7e552f..2ef5ba3 100644
--- a/src/lib/module.c
+++ b/src/lib/module.c
@@ -65,7 +65,7 @@ read_keyword_decl(struct aplwc *aplwc, struct aplwc_module *module, size_t offse
#define t(n) module->tokens->tokens[offset+(n)]
- max = module->tokens->length - offset;
+ max = module->tokens->length - offset - 1;
assert(t(0).tag == TOKEN_TAG_KEYWORD);
switch(t(0).data.keyword){
@@ -103,12 +103,9 @@ fail:
}
}
break;
- default:
- assert(0);
- return -1;
}
- if((len >= 0) && (max > (size_t)len))
+ if(ALWAYS(len >= 0) && (max > (size_t)len))
if(t(len+1).tag != TOKEN_TAG_NEWLINE)
goto fail;
len++; /* For the keyword itself */