Commit 6c6d65896b4a60cb147c853ed0c38882ff0c61c5

Stefan Sperling 2018-01-12T21:21:09

use strerror_r()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
 }