summaryrefslogtreecommitdiff
path: root/text2pcap-scanner.l
diff options
context:
space:
mode:
Diffstat (limited to 'text2pcap-scanner.l')
-rw-r--r--text2pcap-scanner.l21
1 files changed, 12 insertions, 9 deletions
diff --git a/text2pcap-scanner.l b/text2pcap-scanner.l
index e54e4279a9..1f45f8efda 100644
--- a/text2pcap-scanner.l
+++ b/text2pcap-scanner.l
@@ -88,13 +88,16 @@ eol \r?\n\r?
%%
-{byte} { parse_token(T_BYTE, yytext); }
-{byte_eol} { parse_token(T_BYTE, yytext); parse_token(T_EOL, NULL); }
-{offset} { parse_token(T_OFFSET, yytext); }
-{offset_eol} { parse_token(T_OFFSET, yytext); parse_token(T_EOL, NULL); }
-{mailfwd}{offset} { parse_token(T_OFFSET, yytext+1); }
-{eol} { parse_token(T_EOL, NULL); }
+{byte} { if (parse_token(T_BYTE, yytext) != EXIT_SUCCESS) return EXIT_FAILURE; }
+{byte_eol} { if (parse_token(T_BYTE, yytext) != EXIT_SUCCESS) return EXIT_FAILURE;
+ if (parse_token(T_EOL, NULL) != EXIT_SUCCESS) return EXIT_FAILURE; }
+{offset} { if (parse_token(T_OFFSET, yytext) != EXIT_SUCCESS) return EXIT_FAILURE; }
+{offset_eol} { if (parse_token(T_OFFSET, yytext) != EXIT_SUCCESS) return EXIT_FAILURE;
+ if (parse_token(T_EOL, NULL) != EXIT_SUCCESS) return EXIT_FAILURE; }
+{mailfwd}{offset} { if (parse_token(T_OFFSET, yytext+1) != EXIT_SUCCESS) return EXIT_FAILURE; }
+{eol} { if (parse_token(T_EOL, NULL) != EXIT_SUCCESS) return EXIT_FAILURE; }
[ \t] ; /* ignore whitespace */
-{directive} { parse_token(T_DIRECTIVE, yytext); parse_token(T_EOL, NULL); }
-{comment} { parse_token(T_EOL, NULL); }
-{text} { parse_token(T_TEXT, yytext); }
+{directive} { if (parse_token(T_DIRECTIVE, yytext) != EXIT_SUCCESS) return EXIT_FAILURE;
+ if (parse_token(T_EOL, NULL) != EXIT_SUCCESS) return EXIT_FAILURE; }
+{comment} { if (parse_token(T_EOL, NULL) != EXIT_SUCCESS) return EXIT_FAILURE; }
+{text} { if (parse_token(T_TEXT, yytext) != EXIT_SUCCESS) return EXIT_FAILURE; }