awk: handle bad/incomplete input in maketab (thanks kenji arisawa)
This commit is contained in:
parent
ea413b4a62
commit
178e05f9b7
1 changed files with 2 additions and 2 deletions
|
@ -133,8 +133,8 @@ void main(int, char**)
|
|||
i = 0;
|
||||
while ((buf = Brdline(fp, '\n')) != nil) {
|
||||
buf[Blinelen(fp)-1] = '\0';
|
||||
tokenize(buf, toks, 3);
|
||||
if (toks[0] == nil || strcmp("#define", toks[0]) != 0) /* not a valid #define */
|
||||
if (tokenize(buf, toks, 3) != 3
|
||||
|| strcmp("#define", toks[0]) != 0) /* not a valid #define */
|
||||
continue;
|
||||
tok = strtol(toks[2], nil, 10);
|
||||
if (tok < FIRSTTOKEN || tok > LASTTOKEN) {
|
||||
|
|
Loading…
Reference in a new issue