From: Pavel A <pavel.aron...@daynix.com> Signed-off-by: Pavel A <pavel.aron...@daynix.com> --- common/compat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/common/compat.c b/common/compat.c index f5b88ec..8ad35b7 100644 --- a/common/compat.c +++ b/common/compat.c @@ -840,7 +840,14 @@ strerror_r (int errnum, size_t buflen) { #ifdef OS_WIN32 - return strerror_s (buf, buflen, errnum); + /* strerror_s in MSVCRT.DLL is like strerror_r + * but exists only since Win2003. Using strerror + * to keep compatibility with WinXP. + */ + char const *p = strerror(errnum); + strncpy(buf, p ? p : "", buflen - 1); + buf[buflen - 1] = 0; + return 0; #else #error no strerror_r implementation #endif -- 1.9.3 _______________________________________________ p11-glue mailing list p11-glue@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/p11-glue