diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -3,7 +3,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or + the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -205,7 +205,7 @@ static void show_version( void ) printf( "%s %s\n", program_name, PROGVERSION ); printf( "Copyright (C) %s Antonio Diaz Diaz.\n", program_year ); printf( "Using lzlib %s\n", LZ_version() ); - printf( "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n" + printf( "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" ); } @@ -488,17 +488,17 @@ static void close_and_set_permissions( const struct stat * const in_statsp ) */ static int readblock( const int fd, uint8_t * const buf, const int size ) { - int rest = size; + int sz = 0; errno = 0; - while( rest > 0 ) + while( sz < size ) { - const int n = read( fd, buf + size - rest, rest ); - if( n > 0 ) rest -= n; + const int n = read( fd, buf + sz, size - sz ); + if( n > 0 ) sz += n; else if( n == 0 ) break; /* EOF */ else if( errno != EINTR ) break; errno = 0; } - return size - rest; + return sz; } @@ -507,16 +507,16 @@ static int readblock( const int fd, uint8_t * const buf, const int size ) */ static int writeblock( const int fd, const uint8_t * const buf, const int size ) { - int rest = size; + int sz = 0; errno = 0; - while( rest > 0 ) + while( sz < size ) { - const int n = write( fd, buf + size - rest, rest ); - if( n > 0 ) rest -= n; + const int n = write( fd, buf + sz, size - sz ); + if( n > 0 ) sz += n; else if( n < 0 && errno != EINTR ) break; errno = 0; } - return size - rest; + return sz; } |