updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / lib32-flex / flex-2.5.35-hardening.patch
blob7d608ea2371fa3295bdb8eb97c15eeb03029c02b
1 diff -u flex-2.5.35/scan.c flex-2.5.35/scan.c
2 --- flex-2.5.35/scan.c
3 +++ flex-2.5.35/scan.c
4 @@ -2096,7 +2096,7 @@
5 /* This used to be an fputs(), but since the string might contain NUL's,
6 * we now use fwrite().
7 */
8 -#define ECHO fwrite( yytext, yyleng, 1, yyout )
9 +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
10 #endif
12 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
13 diff -u flex-2.5.35/flex.skl flex-2.5.35/flex.skl
14 --- flex-2.5.35/flex.skl
15 +++ flex-2.5.35/flex.skl
16 @@ -1075,7 +1075,7 @@
17 /* This used to be an fputs(), but since the string might contain NUL's,
18 * we now use fwrite().
20 -#define ECHO fwrite( yytext, yyleng, 1, yyout )
21 +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
22 %endif
23 %if-c++-only C++ definition
24 #define ECHO LexerOutput( yytext, yyleng )
25 diff -u flex-2.5.35/skel.c flex-2.5.35/skel.c
26 --- flex-2.5.35/skel.c
27 +++ flex-2.5.35/skel.c
28 @@ -1142,7 +1142,7 @@
29 "/* This used to be an fputs(), but since the string might contain NUL's,",
30 " * we now use fwrite().",
31 " */",
32 - "#define ECHO fwrite( yytext, yyleng, 1, yyout )",
33 + "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)",
34 "%endif",
35 "%if-c++-only C++ definition",
36 "#define ECHO LexerOutput( yytext, yyleng )",