use strerror_r()
diff --git a/lib/error.c b/lib/error.c
index 5ad5f52..475489f 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -41,8 +41,9 @@ const struct got_error *
got_error_from_errno()
{
static struct got_error err;
+ static char msg[1024];
err.code = GOT_ERR_ERRNO;
- err.msg = strerror(errno);
+ strerror_r(errno, msg, sizeof(msg));
return &err;
}