]> Sergey Matveev's repositories - bfs.git/commitdiff
bfstd: Actually use the copied locale
authorTavian Barnes <tavianator@tavianator.com>
Fri, 13 Oct 2023 03:45:40 +0000 (23:45 -0400)
committerTavian Barnes <tavianator@tavianator.com>
Fri, 13 Oct 2023 03:45:40 +0000 (23:45 -0400)
This fixes a segfault in xstrerror() when using musl.

src/bfstd.c

index e9214d4e2ff0434b0e9d3426bc972d6569dc5d03..a4ae4397cfd3042b6c4dae08073e054d61fa32ff 100644 (file)
@@ -301,7 +301,7 @@ const char *xstrerror(int errnum) {
        }
 
        if (copy != (locale_t)0) {
-               ret = strerror_l(errnum, loc);
+               ret = strerror_l(errnum, copy);
        }
 
        if (loc == LC_GLOBAL_LOCALE) {