Reported by Kirill Furman <kfurman@astralinux.ru> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00037.html>.
* lib/quotearg.c (set_char_quoting): Use 'unsigned int', not 'int', for
doing bit mask operations.
+2025-03-10 Bruno Haible <bruno@clisp.org>
+
+ quotearg: Avoid undefined behaviour.
+ Reported by Kirill Furman <kfurman@astralinux.ru> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00037.html>.
+ * lib/quotearg.c (set_char_quoting): Use 'unsigned int', not 'int', for
+ doing bit mask operations.
+
2025-03-09 Bruno Haible <bruno@clisp.org>
getlogin_r: Work around musl bug.
unsigned int *p =
(o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS;
int shift = uc % INT_BITS;
- int r = (*p >> shift) & 1;
- *p ^= ((i & 1) ^ r) << shift;
+ unsigned int r = (*p >> shift) & 1;
+ *p ^= ((i & 1U) ^ r) << shift;
return r;
}