+2008-02-11 Martin Mares <mj@ucw.cz>
+
+ * lib/names.c: Fix displaying of errors reported by zlib.
+ Previously, the buffer containing the error message had
+ been deallocated by gzclose() before the message was printed.
+
2008-01-07 Martin Mares <mj@ucw.cz>
* update-pciids.sh: Added quiet mode (-q). Clean up uncompressed
/*
* The PCI Library -- ID to Name Translation
*
- * Copyright (c) 1997--2007 Martin Mares <mj@ucw.cz>
+ * Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
#define PCI_ERROR(f, err) \
if (!err) { \
int errnum; \
- err = gzerror(f, &errnum); \
- if (errnum == Z_ERRNO) err = "I/O error"; \
- else if (errnum >= 0) err = NULL; \
+ gzerror(f, &errnum); \
+ if (errnum >= 0) err = NULL; \
+ else if (errnum == Z_ERRNO) err = "I/O error"; \
+ else err = zError(errnum); \
}
#else
typedef FILE * pci_file;