From 8f5d4c2948d5cb74842bbccf0c6a4f042297e6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Fri, 29 Feb 2008 19:06:57 +0000 Subject: be sure to set header to NULL in case of RPMRC_NOTFOUND --- rpm5compat.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rpm5compat.h b/rpm5compat.h index e3624bd..bf2c927 100644 --- a/rpm5compat.h +++ b/rpm5compat.h @@ -142,9 +142,13 @@ static inline Header headerRead(void * _fd, enum hMagic magicp) { Header h = NULL; const char * msg = NULL; rpmRC rc = rpmpkgRead(item, _fd, &h, &msg); - if (rc != RPMRC_OK) { - rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", item, msg); - rc = RPMRC_FAIL; + switch (rc) { + default: + rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", item, msg); + case RPMRC_NOTFOUND: + h = NULL; + case RPMRC_OK: + break; } msg = _free(msg); return h; -- cgit v1.2.1