aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fref.lex6
1 files changed, 5 insertions, 1 deletions
diff --git a/fref.lex b/fref.lex
index e57eb01..2eaa19d 100644
--- a/fref.lex
+++ b/fref.lex
@@ -124,7 +124,11 @@ field()
yytext[strcspn(yytext, "\n")] = 0;
/* Fill corresponding field. */
- #define FI(s,m) if(strncmp(yytext,s,2) == 0 && (yytext += 3)){ \
+ #define FI(s,m) if(strncmp(yytext,s,2) == 0){ \
+ /* Don't copy empty field. */ \
+ if(strlen(yytext) < 3) \
+ return; \
+ yytext += 3; \
strcpy(m, yytext); \
return; \
}