Correct use of strerror_r(); we always need to use the return value.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 15 Apr 2013 22:41:04 +0000 (00:41 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 15 Apr 2013 22:41:04 +0000 (00:41 +0200)
log.cpp

diff --git a/log.cpp b/log.cpp
index a4f9236..c594988 100644 (file)
--- a/log.cpp
+++ b/log.cpp
@@ -116,6 +116,5 @@ void log(LogLevel log_level, const char *fmt, ...)
 void log_perror(const char *msg)
 {
        char errbuf[4096];
-       strerror_r(errno, errbuf, sizeof(errbuf));
-       log(ERROR, "%s: %s", msg, errbuf);
+       log(ERROR, "%s: %s", msg, strerror_r(errno, errbuf, sizeof(errbuf)));
 }