diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 14:04:50 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 14:04:50 +0000 |
commit | b4fbba1e1c23c404b9e81ec1ad4fa703fbcdc0f4 (patch) | |
tree | aaf89c31e25065d2f5a3b1d596b99029649d6f28 /main.c | |
parent | Adding upstream version 1.6~rc1. (diff) | |
download | lzlib-b4fbba1e1c23c404b9e81ec1ad4fa703fbcdc0f4.tar.xz lzlib-b4fbba1e1c23c404b9e81ec1ad4fa703fbcdc0f4.zip |
Adding upstream version 1.6~rc2.upstream/1.6_rc2
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-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; } |