More fixes for gzopen_w().
Also need to #include <stddef.h> for zlib.h, and need to workaround the inability to use wide characters in constructed error messages with zlib's interface.
This commit is contained in:
5
gzlib.c
5
gzlib.c
@@ -185,12 +185,13 @@ local gzFile gz_open(path, fd, mode)
|
||||
}
|
||||
|
||||
/* save the path name for error messages */
|
||||
state->path = malloc(strlen(path) + 1);
|
||||
# define WPATH "<widepath>"
|
||||
state->path = malloc(strlen(fd == -2 ? WPATH : (path) + 1);
|
||||
if (state->path == NULL) {
|
||||
free(state);
|
||||
return NULL;
|
||||
}
|
||||
strcpy(state->path, path);
|
||||
strcpy(state->path, fd == -2 ? WPATH : path);
|
||||
|
||||
/* compute the flags for open() */
|
||||
oflag =
|
||||
|
||||
Reference in New Issue
Block a user