summaryrefslogtreecommitdiff
path: root/src/port
diff options
context:
space:
mode:
Diffstat (limited to 'src/port')
-rw-r--r--src/port/string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/port/string.c b/src/port/string.c
index cd6a93f..e05dfbd 100644
--- a/src/port/string.c
+++ b/src/port/string.c
@@ -48,6 +48,7 @@ char *wolf_port_strdup( const char *s ) {
#include <errno.h> /* for errno */
int wolf_port_strerror_r( int num, char *buf, size_t buflen ) {
+ int safe_errno = errno;
const char *msg;
msg = strerror( num );
@@ -64,7 +65,7 @@ int wolf_port_strerror_r( int num, char *buf, size_t buflen ) {
}
strncpy( buf, msg, buflen-1 );
- errno = 0;
+ errno = safe_errno;
return 0;
}