diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-08 17:28:33 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-08 17:28:33 +0100 |
| commit | 5f59a34ab747dde8ede7357f3431bf06bd6002fe (patch) | |
| tree | 056a4477fd870d454d5be5868cddab829a47f4d2 /tests/unistr/test-strnlen.h | |
| parent | 27dae84ed92f1ef0300263091972338d12e78348 (diff) | |
New upstream version 1.4.2upstream/1.4.2upstream
Diffstat (limited to 'tests/unistr/test-strnlen.h')
| -rw-r--r-- | tests/unistr/test-strnlen.h | 10 |
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); |
