diff options
Diffstat (limited to 'gzlib.c')
-rw-r--r-- | gzlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -185,12 +185,13 @@ local gzFile gz_open(path, fd, mode) | |||
185 | } | 185 | } |
186 | 186 | ||
187 | /* save the path name for error messages */ | 187 | /* save the path name for error messages */ |
188 | state->path = malloc(strlen(path) + 1); | 188 | # define WPATH "<widepath>" |
189 | state->path = malloc(strlen(fd == -2 ? WPATH : (path) + 1); | ||
189 | if (state->path == NULL) { | 190 | if (state->path == NULL) { |
190 | free(state); | 191 | free(state); |
191 | return NULL; | 192 | return NULL; |
192 | } | 193 | } |
193 | strcpy(state->path, path); | 194 | strcpy(state->path, fd == -2 ? WPATH : path); |
194 | 195 | ||
195 | /* compute the flags for open() */ | 196 | /* compute the flags for open() */ |
196 | oflag = | 197 | oflag = |