From 2085f874f8ee88e8953a76c578f870cb6679534d Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 22 Oct 1999 19:35:26 +0000 Subject: Fix a couple of segfaults in error handling code [originally from svn r250] --- input.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'input.c') 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), -- cgit v1.1