ee03b19c7a
o rename three patches to 'update-patches' naming conventions o add 64bit patches o add other tidbits from my opencm://opencm.org/everyone/todd@fries.net/home/merge-candidate branch
35 lines
1.3 KiB
Plaintext
35 lines
1.3 KiB
Plaintext
$OpenBSD: patch-base_zlib_gzio_c,v 1.1 2002/08/27 17:43:14 todd Exp $
|
|
--- base/zlib/gzio.c.orig Mon Jul 22 01:37:42 2002
|
|
+++ base/zlib/gzio.c Tue Aug 27 12:25:27 2002
|
|
@@ -681,6 +681,7 @@ z_off_t ZEXPORT gzseek (file, offset, wh
|
|
/* At this point, offset is the number of zero bytes to write. */
|
|
if (s->inbuf == Z_NULL) {
|
|
s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
|
|
+ if (s->inbuf == Z_NULL) return -1L;
|
|
zmemzero(s->inbuf, Z_BUFSIZE);
|
|
}
|
|
while (offset > 0) {
|
|
@@ -723,6 +724,7 @@ z_off_t ZEXPORT gzseek (file, offset, wh
|
|
|
|
if (offset != 0 && s->outbuf == Z_NULL) {
|
|
s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
|
|
+ if (s->outbuf == Z_NULL) return -1L;
|
|
}
|
|
while (offset > 0) {
|
|
int size = Z_BUFSIZE;
|
|
@@ -862,12 +864,13 @@ const char* ZEXPORT gzerror (file, errn
|
|
*errnum = s->z_err;
|
|
if (*errnum == Z_OK) return (const char*)"";
|
|
|
|
- m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
|
|
+ m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
|
|
|
|
if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
|
|
|
|
TRYFREE(s->msg);
|
|
s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
|
|
+ if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR);
|
|
strcpy(s->msg, s->path);
|
|
strcat(s->msg, ": ");
|
|
strcat(s->msg, m);
|