From c950a0a70d37f962bbef66221ff0a23cad450195 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Fri, 27 Feb 2026 12:16:47 +0100 Subject: Fix stale filename comment, const qualifier, and int-to-size_t casts - test_preload.c: @file main.c -> @file test_preload.c - show_alloc_mem.c, test_preload.c: hex array -> static const - show_alloc_mem.c, test_preload.c, test_random.c: use size_t for sizeof-derived indices instead of casting to int --- tests/src/test_random.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/src/test_random.c') diff --git a/tests/src/test_random.c b/tests/src/test_random.c index 396abf9..89284a0 100644 --- a/tests/src/test_random.c +++ b/tests/src/test_random.c @@ -31,9 +31,9 @@ static void _s_put_nbr (int n) { char buf[12]; - int i; + size_t i; - i = (int)sizeof (buf); + i = sizeof (buf); if (n == 0) buf[--i] = '0'; while (n > 0) @@ -41,7 +41,7 @@ _s_put_nbr (int n) buf[--i] = '0' + (n % 10); n /= 10; } - write (1, buf + i, (size_t)(sizeof (buf) - i)); + write (1, buf + i, sizeof (buf) - i); } static unsigned char -- cgit v1.2.3