* tests/test-dfa-match-aux.c (main): Use strnul.
* tests/test-pthread-rwlock-waitqueue.c (reader_func, writer_func):
Likewise.
* tests/test-strtold.h (test_function): Likewise.
* tests/test-xstrtold.c (main): Likewise.
* modules/dfa-tests (Depends-on): Add strnul.
* modules/pthread-rwlock-extra-tests (Depends-on): Likewise.
* modules/c-strtold-tests (Depends-on): Likewise.
* modules/strtold-tests (Depends-on): Likewise.
* modules/xstrtold-tests (Depends-on): Likewise.
+2026-03-01 Bruno Haible <bruno@clisp.org>
+
+ tests: Use strnul.
+ * tests/test-dfa-match-aux.c (main): Use strnul.
+ * tests/test-pthread-rwlock-waitqueue.c (reader_func, writer_func):
+ Likewise.
+ * tests/test-strtold.h (test_function): Likewise.
+ * tests/test-xstrtold.c (main): Likewise.
+ * modules/dfa-tests (Depends-on): Add strnul.
+ * modules/pthread-rwlock-extra-tests (Depends-on): Likewise.
+ * modules/c-strtold-tests (Depends-on): Likewise.
+ * modules/strtold-tests (Depends-on): Likewise.
+ * modules/xstrtold-tests (Depends-on): Likewise.
+
2026-03-01 Bruno Haible <bruno@clisp.org>
tests: Use memeq, part 3.
thread
nanosleep
strtold
+strnul
configure.ac:
gt_LOCALE_FR
regex
setlocale
test-framework-sh
+strnul
configure.ac:
pthread-thread
nanosleep
bool
+strnul
configure.ac:
isnanl-nolibm
signbit-no-c++
setlocale
+strnul
configure.ac:
gt_LOCALE_FR
float-h
isnanl-nolibm
signbit-no-c++
+strnul
configure.ac:
dfacomp (argv[1], strlen (argv[1]), dfa, 0);
beg = argv[2];
- end = argv[2] + strlen (argv[2]);
+ end = strnul (argv[2]);
allow_nl = argc > 3 && atoi (argv[3]);
p = dfaexec (dfa, beg, end, allow_nl, NULL, NULL);
abort ();
}
ASSERT (pthread_rwlock_wrlock (&sprintf_lock) == 0);
- sprintf (l->result + strlen (l->result), " %s", l->name);
+ sprintf (strnul (l->result), " %s", l->name);
ASSERT (pthread_rwlock_unlock (&sprintf_lock) == 0);
if (l->wait_after > 0)
{
abort ();
}
ASSERT (pthread_rwlock_wrlock (&sprintf_lock) == 0);
- sprintf (l->result + strlen (l->result), " %s", l->name);
+ sprintf (strnul (l->result), " %s", l->name);
ASSERT (pthread_rwlock_unlock (&sprintf_lock) == 0);
if (l->wait_after > 0)
{
errno = 0;
result = my_strtold (input, &ptr);
ASSERT (0.0L < result && result <= LDBL_MIN);
- ASSERT (ptr == input + strlen (input));
+ ASSERT (ptr == strnul (input));
#if !defined _MSC_VER
ASSERT (errno == ERANGE);
#endif
errno = 0;
result = my_strtold (input, &ptr);
ASSERT (-LDBL_MIN <= result && result < 0.0L);
- ASSERT (ptr == input + strlen (input));
+ ASSERT (ptr == strnul (input));
#if !defined _MSC_VER
ASSERT (errno == ERANGE);
#endif
bool ok = xstrtold (input, &ptr, &result, strtold);
ASSERT (ok);
ASSERT (0.0L < result && result <= LDBL_MIN);
- ASSERT (ptr == input + strlen (input));
+ ASSERT (ptr == strnul (input));
ASSERT (errno == 0);
}
{
bool ok = xstrtold (input, &ptr, &result, strtold);
ASSERT (ok);
ASSERT (-LDBL_MIN <= result && result < 0.0L);
- ASSERT (ptr == input + strlen (input));
+ ASSERT (ptr == strnul (input));
ASSERT (errno == 0);
}