diff options
author | David Sommerseth <davids@redhat.com> | 2010-01-08 19:20:43 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2010-01-08 19:20:43 +0100 |
commit | fbc7a2ea8f6510f14a5f670dbd1ed8d7b87bac20 (patch) | |
tree | 954335fb9d1070b67e6ea3a11c1bed0fa766744e /src | |
parent | fb3f735aaf84e6b6d2f37907ed9e6a8b014e76bb (diff) | |
download | python-dmidecode-fbc7a2ea8f6510f14a5f670dbd1ed8d7b87bac20.tar.gz python-dmidecode-fbc7a2ea8f6510f14a5f670dbd1ed8d7b87bac20.tar.xz python-dmidecode-fbc7a2ea8f6510f14a5f670dbd1ed8d7b87bac20.zip |
Don't print false error warning if logp == NULL
Diffstat (limited to 'src')
-rw-r--r-- | src/dmilog.c | 8 |
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); |