diff --git a/gzlib.c b/gzlib.c index 7a37a96cf0..78702174ca 100644 --- a/gzlib.c +++ b/gzlib.c @@ -299,7 +299,7 @@ gzFile ZEXPORT gzdopen(int fd, const char *mode) { char *path; /* identifier for error messages */ gzFile gz; - if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL) + if (fd < 0 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL) return NULL; #if !defined(NO_snprintf) && !defined(NO_vsnprintf) (void)snprintf(path, 7 + 3 * sizeof(int), "", fd);