diff options
author | Guido van Rossum <guido@python.org> | 1994-12-30 15:46:02 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1994-12-30 15:46:02 (GMT) |
commit | 588633daa2fe7276ae4b0c99723094add0d965ff (patch) | |
tree | 531b98a64c67825f81af62a682cacc29707b4b6a /Parser/tokenizer.c | |
parent | 66cb311fba7e824f11964090bce8b6b91f00d2e4 (diff) | |
download | cpython-588633daa2fe7276ae4b0c99723094add0d965ff.zip cpython-588633daa2fe7276ae4b0c99723094add0d965ff.tar.gz cpython-588633daa2fe7276ae4b0c99723094add0d965ff.tar.bz2 |
Parser/tokenizer.c (tok_nextc): zap tok->buf after freeing;
rest: abort() -> fatal(); small things
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r-- | Parser/tokenizer.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 7c25450..baed65d 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -209,6 +209,7 @@ tok_nextc(tok) tok->lineno++; if (buf == NULL) { free(tok->buf); + tok->buf = NULL; free(new); tok->done = E_NOMEM; return EOF; @@ -309,10 +310,8 @@ tok_backup(tok, c) register int c; { if (c != EOF) { - if (--tok->cur < tok->buf) { - fprintf(stderr, "tok_backup: begin of buffer\n"); - abort(); - } + if (--tok->cur < tok->buf) + fatal("tok_backup: begin of buffer"); if (*tok->cur != c) *tok->cur = c; } |