summaryrefslogtreecommitdiffstats
path: root/src/dmilog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dmilog.c')
-rw-r--r--src/dmilog.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dmilog.c b/src/dmilog.c
index acc465f..e9b89e8 100644
--- a/src/dmilog.c
+++ b/src/dmilog.c
@@ -85,7 +85,13 @@ int log_append(Log_t *logp, int level, const char *fmt, ...)
va_start(ap, fmt);
if( !ptr || !ptr->next || !ptr->next->message ) {
- fprintf(stderr, "** ERROR ** Failed to save log entry\n");
+ if( logp ) {
+ // Only print this if we logp is pointing somewhere.
+ // If it is NULL, the caller did not establish a log
+ // buffer on purpose (like dmidump.c) - thus this is
+ // not an error with saving the log entry.
+ fprintf(stderr, "** ERROR ** Failed to save log entry\n");
+ }
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
va_end(ap);