From d38733b97417d5495142cf3a75d6e43d989a140a Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sun, 2 Dec 2001 09:32:49 +0000 Subject: [PATCH] Corrected maximum line check length to avoid multiple error messages on same line. --- gedcom_lex_common.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gedcom_lex_common.c b/gedcom_lex_common.c index d547ea4..5829633 100644 --- a/gedcom_lex_common.c +++ b/gedcom_lex_common.c @@ -76,13 +76,14 @@ int test_loop(ENCODING enc, char* code) line_len = 0; #define CHECK_LINE_LEN \ - { if (line_len != (size_t)-1) \ + { if (line_len != (size_t)-1) { \ line_len += strlen(yytext); \ - if (line_len > MAXGEDCLINELEN * encoding_width) { \ - gedcom_error("Line too long, max %d characters", \ - MAXGEDCLINELEN); \ - line_len = (size_t)-1; \ - return BADTOKEN; \ + if (line_len > MAXGEDCLINELEN * encoding_width) { \ + gedcom_error("Line too long, max %d characters", \ + MAXGEDCLINELEN); \ + line_len = (size_t)-1; \ + return BADTOKEN; \ + } \ } \ } -- 2.30.2