aboutsummaryrefslogtreecommitdiffstats
path: root/src/slibc-error.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/slibc-error.c')
-rw-r--r--src/slibc-error.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/slibc-error.c b/src/slibc-error.c
index fd103d1..26724f9 100644
--- a/src/slibc-error.c
+++ b/src/slibc-error.c
@@ -34,7 +34,7 @@
*
* This is a slibc extension.
*
- * @param progname The name of the program, `NULL` to use `program_invocation_name`.
+ * @param progname The name of the program, `NULL` or empty to use `program_invocation_name`.
* @param filename The source code file where the error occurred.
* @param linenum The line in the source code where the error occurred.
* @param function The function in the source code where the error occurred.
@@ -51,7 +51,7 @@ void slibc_perror(const char* progname, const char* filename, int linenum, const
int tty = isatty(STDERR_FILENO);
va_list args;
- if (progname == NULL)
+ if ((progname == NULL) || !*progname)
progname = program_invocation_name;
if (*error_code)