diff --git a/src/flb_pal.c b/src/flb_pal.c index 719d7a1f29e..35c33e17f68 100644 --- a/src/flb_pal.c +++ b/src/flb_pal.c @@ -60,10 +60,15 @@ int flb_strerror_r(int errnum, char *buf, size_t buflen) return ret; #else - return strerror_r(errnum, buf, buflen); + return strerror_r(errnum, buf, buflen); #endif #elif defined(FLB_HAVE_STRERROR_S) - return (int) strerror_s(buf, (rsize_t)buflen, (errno_t)errnum); + int ret; + + ret = (int) strerror_s(buf, (rsize_t)buflen, (errno_t)errnum); + if (0 != ret) { + ret = ERANGE; + } #endif } #endif