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:
parent
37d4f523d3
commit
386e4642dc
1 changed files with 2 additions and 1 deletions
|
|
@ -25,9 +25,10 @@
|
|||
size_t
|
||||
strnlen (const char *s, size_t maxlen)
|
||||
{
|
||||
size_t i = 0;
|
||||
/* Do not use memchr, because on some platforms memchr has
|
||||
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;
|
||||
return i;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue