X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils%2Fcommon%2Fcommon.c;h=7cfd31096bb7f82d109b7905b0aa817593d4c90c;hb=21c84cec32921e6de8feaa5496f337496379ea23;hp=6ee4e081fb3f765b652406bd9c4f7fdb8d5ed045;hpb=06d8ab31ff97b30d601e8f8a942bedc339825042;p=collectd.git diff --git a/src/utils/common/common.c b/src/utils/common/common.c index 6ee4e081..7cfd3109 100644 --- a/src/utils/common/common.c +++ b/src/utils/common/common.c @@ -181,7 +181,7 @@ char *sstrerror(int errnum, char *buf, size_t buflen) { pthread_mutex_unlock(&strerror_r_lock); } -/* #endif !HAVE_STRERROR_R */ + /* #endif !HAVE_STRERROR_R */ #elif STRERROR_R_CHAR_P { @@ -191,17 +191,19 @@ char *sstrerror(int errnum, char *buf, size_t buflen) { if ((temp != NULL) && (temp != buf) && (temp[0] != '\0')) sstrncpy(buf, temp, buflen); else - sstrncpy(buf, "strerror_r did not return " - "an error message", + sstrncpy(buf, + "strerror_r did not return " + "an error message", buflen); } } -/* #endif STRERROR_R_CHAR_P */ + /* #endif STRERROR_R_CHAR_P */ #else if (strerror_r(errnum, buf, buflen) != 0) { - snprintf(buf, buflen, "Error #%i; " - "Additionally, strerror_r failed.", + snprintf(buf, buflen, + "Error #%i; " + "Additionally, strerror_r failed.", errnum); } #endif /* STRERROR_R_CHAR_P */ @@ -767,8 +769,8 @@ unsigned long long htonll(unsigned long long n) { #endif /* HAVE_HTONLL */ #if FP_LAYOUT_NEED_NOTHING -/* Well, we need nothing.. */ -/* #endif FP_LAYOUT_NEED_NOTHING */ + /* Well, we need nothing.. */ + /* #endif FP_LAYOUT_NEED_NOTHING */ #elif FP_LAYOUT_NEED_ENDIANFLIP || FP_LAYOUT_NEED_INTSWAP #if FP_LAYOUT_NEED_ENDIANFLIP