From 1cb5c08f6294db9d86fa2a887c730f90e150d4ae Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 26 Sep 2019 22:01:24 +0200 Subject: [PATCH] Fix winerror() returning a pointer to a stack-allocated array. Found by cppcheck. --- src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 94052d3d..6e1c4ccb 100644 --- a/src/utils.c +++ b/src/utils.c @@ -178,7 +178,7 @@ int b64encode_urlsafe(const void *src, char *dst, int length) { #endif const char *winerror(int err) { - char buf[1024], *ptr; + static char buf[1024], *ptr; ptr = buf + sprintf(buf, "(%d) ", err); -- 2.39.5