Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
pbzip2
pbzip2-fix_unused_result.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pbzip2-fix_unused_result.patch of Package pbzip2
--- pbzip2.cpp.orig 2010-12-20 19:34:24.000000000 +0100 +++ pbzip2.cpp 2010-12-20 19:44:06.000000000 +0100 @@ -1802,7 +1802,17 @@ return ret; } if (nread > 0) - (void) fwrite (obuf, sizeof(unsigned char), nread, stream); + { + if (fwrite (obuf, sizeof(unsigned char), nread, stream) < nread) + { + fprintf(stderr, "pbzip2: *ERROR: Failed to write to output file %s. Aborting!\n", OutFilename); + if (zStream != stdin) + fclose(zStream); + if (stream != stdout) + fclose(stream); + return -1; + } + } if (ferror(stream)) { ret = testBZ2ErrorHandling(bzerr, bzf, streamNo); @@ -1817,7 +1827,17 @@ } } if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0) - (void) fwrite(obuf, sizeof(unsigned char), nread, stream ); + { + if (fwrite(obuf, sizeof(unsigned char), nread, stream ) < nread) + { + fprintf(stderr, "pbzip2: *ERROR: Failed to write to output file %s. Aborting!\n", OutFilename); + if (zStream != stdin) + fclose(zStream); + if (stream != stdout) + fclose(stream); + return -1; + } + } if (ferror(stream)) { ret = testBZ2ErrorHandling(bzerr, bzf, streamNo);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor