Corrected maximum line check length to avoid multiple error messages on
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 2 Dec 2001 09:32:49 +0000 (09:32 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 2 Dec 2001 09:32:49 +0000 (09:32 +0000)
same line.

gedcom_lex_common.c

index d547ea4fa8eb6683e920cd60cef8772dc8250784..58296331b732313651202cf5042a1234097c3889 100644 (file)
@@ -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;                                                      \
+      }                                                                       \
     }                                                                         \
   }