diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:17:02 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:17:02 -0700 |
commit | ff11b0a61f7345572ff2e413173d3179486162f2 (patch) | |
tree | f3c9e2563c4f0ac6684a0012ad48423d4c6aa798 /gzio.c | |
parent | e26a448e9673d67dc2866e11a48d24fc352e5f80 (diff) | |
download | zlib-ff11b0a61f7345572ff2e413173d3179486162f2.tar.gz zlib-ff11b0a61f7345572ff2e413173d3179486162f2.tar.bz2 zlib-ff11b0a61f7345572ff2e413173d3179486162f2.zip |
zlib 1.0.4v1.0.4
Diffstat (limited to 'gzio.c')
-rw-r--r-- | gzio.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -3,7 +3,7 @@ | |||
3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
4 | */ | 4 | */ |
5 | 5 | ||
6 | /* $Id: gzio.c,v 1.13 1996/05/22 11:52:24 me Exp $ */ | 6 | /* $Id: gzio.c,v 1.14 1996/07/24 13:41:01 me Exp $ */ |
7 | 7 | ||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | 9 | ||
@@ -496,7 +496,7 @@ int gzclose (file) | |||
496 | errnum is set to Z_ERRNO and the application may consult errno | 496 | errnum is set to Z_ERRNO and the application may consult errno |
497 | to get the exact error code. | 497 | to get the exact error code. |
498 | */ | 498 | */ |
499 | char* gzerror (file, errnum) | 499 | const char* gzerror (file, errnum) |
500 | gzFile file; | 500 | gzFile file; |
501 | int *errnum; | 501 | int *errnum; |
502 | { | 502 | { |
@@ -505,19 +505,19 @@ char* gzerror (file, errnum) | |||
505 | 505 | ||
506 | if (s == NULL) { | 506 | if (s == NULL) { |
507 | *errnum = Z_STREAM_ERROR; | 507 | *errnum = Z_STREAM_ERROR; |
508 | return ERR_MSG(Z_STREAM_ERROR); | 508 | return (const char*)ERR_MSG(Z_STREAM_ERROR); |
509 | } | 509 | } |
510 | *errnum = s->z_err; | 510 | *errnum = s->z_err; |
511 | if (*errnum == Z_OK) return (char*)""; | 511 | if (*errnum == Z_OK) return (const char*)""; |
512 | 512 | ||
513 | m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg); | 513 | m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg); |
514 | 514 | ||
515 | if (m == NULL || *m == '\0') m = ERR_MSG(s->z_err); | 515 | if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err); |
516 | 516 | ||
517 | TRYFREE(s->msg); | 517 | TRYFREE(s->msg); |
518 | s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3); | 518 | s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3); |
519 | strcpy(s->msg, s->path); | 519 | strcpy(s->msg, s->path); |
520 | strcat(s->msg, ": "); | 520 | strcat(s->msg, ": "); |
521 | strcat(s->msg, m); | 521 | strcat(s->msg, m); |
522 | return s->msg; | 522 | return (const char*)s->msg; |
523 | } | 523 | } |