summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>1999-10-22 19:35:26 +0000
committerSimon Tatham <anakin@pobox.com>1999-10-22 19:35:26 +0000
commit2085f874f8ee88e8953a76c578f870cb6679534d (patch)
treec7ec9374db604b517fac692b9edd823dee2e7873 /input.c
parent8f484cb522ea01737fad808702f61bc20a5c7996 (diff)
downloadhalibut-2085f874f8ee88e8953a76c578f870cb6679534d.zip
halibut-2085f874f8ee88e8953a76c578f870cb6679534d.tar.gz
halibut-2085f874f8ee88e8953a76c578f870cb6679534d.tar.bz2
halibut-2085f874f8ee88e8953a76c578f870cb6679534d.tar.xz
Fix a couple of segfaults in error handling code
[originally from svn r250]
Diffstat (limited to 'input.c')
-rw-r--r--input.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/input.c b/input.c
index 4e40455..9615927 100644
--- a/input.c
+++ b/input.c
@@ -486,10 +486,11 @@ static void read_file(paragraph ***ret, input *in, index *idx) {
addpara(par, ret);
while (t.type != tok_eop) /* error recovery: */
dtor(t), t = get_token(in); /* eat rest of paragraph */
- continue;
+ goto codeparabroken; /* ick, but such is life */
}
}
addpara(par, ret);
+ codeparabroken:
continue;
}
@@ -768,8 +769,10 @@ static void read_file(paragraph ***ret, input *in, index *idx) {
already = TRUE;
wdtext = ustrftime(NULL, broken);
wd.type = style;
- } else
+ } else {
error(err_explbr, &t.pos);
+ wdtext = NULL;
+ }
} else {
rdstring rs = { 0, 0, NULL };
while (dtor(t), t = get_token(in),