summaryrefslogtreecommitdiff
path: root/tests/unistr/test-strnlen.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-10 13:24:07 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-10 13:24:07 +0100
commitcfd1f17f1a85d95ea12bca8dae42add7dad1ad11 (patch)
tree8016486f8ee7157213f2d09ff2491bfa9c94638a /tests/unistr/test-strnlen.h
parent14e4d584d0121031ec40e6c35869745f1747ff29 (diff)
parent1403307d6e2fb4e7b5d97a35f40d1e95134561ab (diff)
Merge branch 'release/debian/1.4.2-1'HEADdebian/1.4.2-1master
Diffstat (limited to 'tests/unistr/test-strnlen.h')
-rw-r--r--tests/unistr/test-strnlen.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/unistr/test-strnlen.h b/tests/unistr/test-strnlen.h
index abc83fb9..e8aff09c 100644
--- a/tests/unistr/test-strnlen.h
+++ b/tests/unistr/test-strnlen.h
@@ -1,5 +1,5 @@
/* Test of uN_strnlen() functions.
- Copyright (C) 2010-2024 Free Software Foundation, Inc.
+ Copyright (C) 2010-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,13 +27,12 @@ static void
check (const UNIT *input, size_t input_length)
{
size_t length;
- size_t n;
ASSERT (input_length > 0);
ASSERT (input[input_length - 1] == 0);
length = input_length - 1; /* = U_STRLEN (input) */
- for (n = 0; n <= 2 * length + 2; n++)
+ for (size_t n = 0; n <= 2 * length + 2; n++)
check_single (input, length, n);
/* Check that U_STRNLEN (S, N) does not look at more than
@@ -43,14 +42,13 @@ check (const UNIT *input, size_t input_length)
if (page_boundary != NULL)
{
- for (n = 0; n <= 2 * length + 2; n++)
+ for (size_t n = 0; n <= 2 * length + 2; n++)
{
size_t n_to_copy = (n <= length ? n : length + 1);
UNIT *copy;
- size_t i;
copy = (UNIT *) page_boundary - n_to_copy;
- for (i = 0; i < n_to_copy; i++)
+ for (size_t i = 0; i < n_to_copy; i++)
copy[i] = input[i];
check_single (copy, length, n);