Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BSON: use strerror instead of strerror_s on Windows for compatibility

WinXP doesn't have "strerror_s".  The "strerror" function is deprecated,
but still available.  We don't actually use any code paths that will
call this, so this fix is a harmless, minimal way to get libbson
compiling on WinXP.
  • Loading branch information...
commit e32c5898298c3e48800e1c31a7c7ff6711fecd3a 1 parent c28fad9
@dagolden dagolden authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 bson/bson-error.c
View
5 bson/bson-error.c
@@ -108,9 +108,8 @@ bson_strerror_r (int err_code, /* IN */
#if defined(__GNUC__) && defined(_GNU_SOURCE)
ret = strerror_r (err_code, buf, buflen);
#elif defined(_WIN32)
- if (strerror_s (buf, buflen, err_code) != 0) {
- ret = buf;
- }
+ bson_strncpy (buf, strerror( err_code ), buflen);
+ ret = buf;
#else /* XSI strerror_r */
if (strerror_r (err_code, buf, buflen) == 0) {
ret = buf;
Please sign in to comment.
Something went wrong with that request. Please try again.