summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/build.c b/build.c
index 179995549..f00e98d26 100644
--- a/build.c
+++ b/build.c
@@ -136,9 +136,9 @@ static char * getTarSpec(const char *arg)
if (!(fp = popen(cmd, "r"))) {
rpmlog(RPMLOG_ERR, _("Failed to open tar pipe: %m\n"));
} else {
- gotspec = fgets(tarbuf, sizeof(tarbuf) - 1, fp) &&
- isSpecFile(tmpSpecFile);
+ char *fok = fgets(tarbuf, sizeof(tarbuf) - 1, fp);
pclose(fp);
+ gotspec = (fok != NULL) && isSpecFile(tmpSpecFile);
}
if (!gotspec)