summaryrefslogtreecommitdiff
path: root/tests/unistr/test-strnlen.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:50 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:50 +0100
commitff33e1d252f46bec1a33e28700da3282fc24047a (patch)
tree5c15bc695be820b393a8496c5807ecafbbdeb89b /tests/unistr/test-strnlen.h
parentb2ac982cc8b5290699eb5f52fb043d3d15e2624b (diff)
parent5f59a34ab747dde8ede7357f3431bf06bd6002fe (diff)
Update upstream source from tag 'upstream/1.4.2'
Update to upstream version '1.4.2' with Debian dir 493e96bcd865e4f9990e20bee26408c96231d727
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 fd0c25cc..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-2025 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);