summaryrefslogtreecommitdiffstats
path: root/gl/setlocale_null-unlocked.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2026-03-26 12:53:53 +0100
committerGitHub <noreply@github.com>2026-03-26 12:53:53 +0100
commit13e14a6bfd9f29cbfeab0c5161d2a994f97532e7 (patch)
tree3aa7186fe092e42783dc7e981dc39a74ea61c466 /gl/setlocale_null-unlocked.c
parent9d8503f90ef25b2cecd324dc118e441f40233ea8 (diff)
downloadmonitoring-plugins-13e14a6bfd9f29cbfeab0c5161d2a994f97532e7.tar.gz
Update/gnulib 2026 03 (#2247)
* Sync with the 202601-stable Gnulib code (4a3650d887) * Ignore more deps stuff in gnulib * Remove autogenerated gnulib files * Ignore more gnulib generated headers
Diffstat (limited to 'gl/setlocale_null-unlocked.c')
-rw-r--r--gl/setlocale_null-unlocked.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gl/setlocale_null-unlocked.c b/gl/setlocale_null-unlocked.c
index 72729e6b..e7f155c7 100644
--- a/gl/setlocale_null-unlocked.c
+++ b/gl/setlocale_null-unlocked.c
@@ -1,5 +1,5 @@
1/* Query the name of the current global locale, without locking. 1/* Query the name of the current global locale, without locking.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc. 2 Copyright (C) 2019-2026 Free Software Foundation, Inc.
3 3
4 This file is free software: you can redistribute it and/or modify 4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as 5 it under the terms of the GNU Lesser General Public License as
@@ -86,10 +86,8 @@ setlocale_null_r_unlocked (int category, char *buf, size_t bufsize)
86 size_t length = wcslen (result); 86 size_t length = wcslen (result);
87 if (length < bufsize) 87 if (length < bufsize)
88 { 88 {
89 size_t i;
90
91 /* Convert wchar_t[] -> char[], assuming plain ASCII. */ 89 /* Convert wchar_t[] -> char[], assuming plain ASCII. */
92 for (i = 0; i <= length; i++) 90 for (size_t i = 0; i <= length; i++)
93 buf[i] = result[i]; 91 buf[i] = result[i];
94 92
95 return 0; 93 return 0;
@@ -101,10 +99,8 @@ setlocale_null_r_unlocked (int category, char *buf, size_t bufsize)
101 /* Return a truncated result in BUF. 99 /* Return a truncated result in BUF.
102 This is a convenience for callers that don't want to write 100 This is a convenience for callers that don't want to write
103 explicit code for handling ERANGE. */ 101 explicit code for handling ERANGE. */
104 size_t i;
105
106 /* Convert wchar_t[] -> char[], assuming plain ASCII. */ 102 /* Convert wchar_t[] -> char[], assuming plain ASCII. */
107 for (i = 0; i < bufsize; i++) 103 for (size_t i = 0; i < bufsize; i++)
108 buf[i] = result[i]; 104 buf[i] = result[i];
109 buf[bufsize - 1] = '\0'; 105 buf[bufsize - 1] = '\0';
110 } 106 }