From 9b3c8db65a842745de3b462dbeb104cdf0a642d0 Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 18 2020 14:33:57 +0000 Subject: Apply patch flex-max_size.patch patch_name: flex-max_size.patch present_in_specfile: true --- diff --git a/src/gen.c b/src/gen.c index 4688709..71f1993 100644 --- a/src/gen.c +++ b/src/gen.c @@ -1875,7 +1875,7 @@ void make_tables (void) if (!C_plus_plus) { if (use_read) { outn ("\terrno=0; \\"); - outn ("\twhile ( (result = (int) read( fileno(yyin), buf, max_size )) < 0 ) \\"); + outn ("\twhile ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \\"); outn ("\t{ \\"); outn ("\t\tif( errno != EINTR) \\"); outn ("\t\t{ \\"); @@ -1891,7 +1891,7 @@ void make_tables (void) outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\"); outn ("\t\t{ \\"); outn ("\t\tint c = '*'; \\"); - outn ("\t\tsize_t n; \\"); + outn ("\t\tint n; \\"); outn ("\t\tfor ( n = 0; n < max_size && \\"); outn ("\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\"); outn ("\t\t\tbuf[n] = (char) c; \\"); @@ -1904,7 +1904,7 @@ void make_tables (void) outn ("\telse \\"); outn ("\t\t{ \\"); outn ("\t\terrno=0; \\"); - outn ("\t\twhile ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \\"); + outn ("\t\twhile ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \\"); outn ("\t\t\t{ \\"); outn ("\t\t\tif( errno != EINTR) \\"); outn ("\t\t\t\t{ \\");