summaryrefslogtreecommitdiff
path: root/lib/common/perror.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/perror.c')
-rw-r--r--lib/common/perror.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/common/perror.c b/lib/common/perror.c
index c7dab08..53a8c16 100644
--- a/lib/common/perror.c
+++ b/lib/common/perror.c
@@ -69,5 +69,11 @@ void sqfs_perror(const char *file, const char *action, int error_code)
break;
}
- fprintf(stderr, "%s: %s: %s.\n", file, action, errstr);
+ if (file != NULL)
+ fprintf(stderr, "%s: ", file);
+
+ if (action != NULL)
+ fprintf(stderr, "%s: ", action);
+
+ fprintf(stderr, "%s.\n", errstr);
}