diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2012-03-18 09:29:44 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2012-03-18 09:29:44 -0700 |
commit | 8e16df2c3f0dbe0f8a819e1913562073cf721636 (patch) | |
tree | 1c91e0b2ccc16ad31c941f5ecfd063776a1bf30d /gzlib.c | |
parent | a1af6e96e35dfc3adfa2acba01883c14115f1090 (diff) | |
download | zlib-8e16df2c3f0dbe0f8a819e1913562073cf721636.tar.gz |
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.
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) } /* 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 = |