diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-10-07 21:29:25 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-10-07 21:29:25 +0200 |
commit | 292d82951d3b85c8580d3b01eb7a9ac1494c02f8 (patch) | |
tree | 564d4c412b184dd03ffe5173da4a0fd2f2b8f2be /src/slibc-error.c | |
parent | m readme (diff) | |
download | slibc-292d82951d3b85c8580d3b01eb7a9ac1494c02f8.tar.gz slibc-292d82951d3b85c8580d3b01eb7a9ac1494c02f8.tar.bz2 slibc-292d82951d3b85c8580d3b01eb7a9ac1494c02f8.tar.xz |
m slibc_perror
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/slibc-error.c | 4 |
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) |