1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

* lib/strnlen.c (strnlen): Fix syntax error in Gnulib module.

This commit is contained in:
Po Lu 2025-11-21 09:49:44 +08:00
parent 37d4f523d3
commit 386e4642dc

View file

@ -25,9 +25,10 @@
size_t size_t
strnlen (const char *s, size_t maxlen) strnlen (const char *s, size_t maxlen)
{ {
size_t i = 0;
/* Do not use memchr, because on some platforms memchr has /* Do not use memchr, because on some platforms memchr has
undefined behavior if MAXLEN exceeds the number of bytes in S. */ undefined behavior if MAXLEN exceeds the number of bytes in S. */
for (size_t i = 0; i < maxlen && s[i]; i++) for (; i < maxlen && s[i]; i++)
continue; continue;
return i; return i;
} }