diff --git a/src/utils/error.c b/src/utils/error.c
index 2bc99013ebe719199b7f53b2665f5e43dd7a95ae..6d23c6bcf68b8e32661e7c49943ccb0c19d9b8b0 100644 (file)
--- a/src/utils/error.c
+++ b/src/utils/error.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
/*
* private data types
char *
sdb_strerror(int errnum, char *strerrbuf, size_t buflen)
{
+ *strerrbuf = '\0';
+
#if STRERROR_R_CHAR_P
{
char *tmp = strerror_r(errnum, strerrbuf, buflen);
- if (*strerrbuf = '\0') {
+ if (*strerrbuf == '\0') {
if (tmp && (tmp != strerrbuf) && (*tmp != '\0'))
strncpy(strerrbuf, tmp, buflen);
else