Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/bc/bc yy_size_t is typically unsigned, so use a sep...



details:   https://anonhg.NetBSD.org/src/rev/b5b2d4f851eb
branches:  trunk
changeset: 786054:b5b2d4f851eb
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Apr 12 18:12:15 2013 +0000

description:
yy_size_t is typically unsigned, so use a separate variable for the
return value of read(2).

diffstat:

 gnu/dist/bc/bc/scan.l |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r bb651db1ba76 -r b5b2d4f851eb gnu/dist/bc/bc/scan.l
--- a/gnu/dist/bc/bc/scan.l     Fri Apr 12 18:11:40 2013 +0000
+++ b/gnu/dist/bc/bc/scan.l     Fri Apr 12 18:12:15 2013 +0000
@@ -84,12 +84,14 @@
 {
   if (!edit || yyin != stdin)
     {
-      while ( (*result = read( fileno(yyin), buf, max )) < 0 )
+      ssize_t rv;
+      while ( (rv = read( fileno(yyin), buf, max )) < 0 )
         if (errno != EINTR)
          {
            yyerror( "read() in flex scanner failed" );
            exit (1);
          }
+      *result = rv;
       return;
     }
 



Home | Main Index | Thread Index | Old Index