aboutsummaryrefslogtreecommitdiff
path: root/gzlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzlib.c')
-rw-r--r--gzlib.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gzlib.c b/gzlib.c
index e4ca576..0500d6c 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -108,7 +108,7 @@ local gzFile gz_open(path, fd, mode)
108 return NULL; 108 return NULL;
109 109
110 /* allocate gzFile structure to return */ 110 /* allocate gzFile structure to return */
111 state = malloc(sizeof(gz_state)); 111 state = (gz_statep)malloc(sizeof(gz_state));
112 if (state == NULL) 112 if (state == NULL)
113 return NULL; 113 return NULL;
114 state->size = 0; /* no buffers allocated yet */ 114 state->size = 0; /* no buffers allocated yet */
@@ -196,8 +196,8 @@ local gzFile gz_open(path, fd, mode)
196 } 196 }
197 else 197 else
198#endif 198#endif
199 len = strlen(path); 199 len = strlen((const char *)path);
200 state->path = malloc(len + 1); 200 state->path = (char *)malloc(len + 1);
201 if (state->path == NULL) { 201 if (state->path == NULL) {
202 free(state); 202 free(state);
203 return NULL; 203 return NULL;
@@ -242,7 +242,7 @@ local gzFile gz_open(path, fd, mode)
242#ifdef _WIN32 242#ifdef _WIN32
243 fd == -2 ? _wopen(path, oflag, 0666) : 243 fd == -2 ? _wopen(path, oflag, 0666) :
244#endif 244#endif
245 open(path, oflag, 0666)); 245 open((const char *)path, oflag, 0666));
246 if (state->fd == -1) { 246 if (state->fd == -1) {
247 free(state->path); 247 free(state->path);
248 free(state); 248 free(state);
@@ -288,7 +288,7 @@ gzFile ZEXPORT gzdopen(fd, mode)
288 char *path; /* identifier for error messages */ 288 char *path; /* identifier for error messages */
289 gzFile gz; 289 gzFile gz;
290 290
291 if (fd == -1 || (path = malloc(7 + 3 * sizeof(int))) == NULL) 291 if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
292 return NULL; 292 return NULL;
293#if !defined(NO_snprintf) && !defined(NO_vsnprintf) 293#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
294 snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */ 294 snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */
@@ -598,7 +598,8 @@ void ZLIB_INTERNAL gz_error(state, err, msg)
598 return; 598 return;
599 599
600 /* construct error message with path */ 600 /* construct error message with path */
601 if ((state->msg = malloc(strlen(state->path) + strlen(msg) + 3)) == NULL) { 601 if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
602 NULL) {
602 state->err = Z_MEM_ERROR; 603 state->err = Z_MEM_ERROR;
603 return; 604 return;
604 } 605 }