aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qpkg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/qpkg.c b/qpkg.c
index eaca37b..7929018 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -308,7 +308,12 @@ qpkg_make(depend_atom *atom)
rmdir(tmpdir);
- stat(buf, &st);
+ if (stat(buf, &st) == -1) {
+ warnp("could not stat '%s': %s", buf strerror(errno));
+ free(buf);
+ return 1;
+ }
+
printf("%s%s%s KiB\n",
RED, make_human_readable_str(st.st_size, 1, KILOBYTE), NORM);