From ce3f1cc0ef9f46d70ab5387b1458e9098b40711d Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 22 Mar 2025 06:43:11 +0100 Subject: Some safety with move arrays, small refactor appendchar --- test/013_math_digitstosumzero/digitstosumzero_tests.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/013_math_digitstosumzero/digitstosumzero_tests.c') diff --git a/test/013_math_digitstosumzero/digitstosumzero_tests.c b/test/013_math_digitstosumzero/digitstosumzero_tests.c index f28c02a..795bd9b 100644 --- a/test/013_math_digitstosumzero/digitstosumzero_tests.c +++ b/test/013_math_digitstosumzero/digitstosumzero_tests.c @@ -1,10 +1,11 @@ #include "../test.h" -int64_t digitstosumzero(uint8_t *, uint8_t, uint8_t); +int64_t digitstosumzero(size_t n, uint8_t [n], uint8_t); void run(void) { char str[STRLENMAX]; - uint8_t i, n, b, a[100]; + uint8_t i, b, a[100]; + size_t n; int64_t p; fgets(str, STRLENMAX, stdin); @@ -16,6 +17,6 @@ void run(void) { a[i] = atoi(str); } - p = digitstosumzero(a, n, b); + p = digitstosumzero(n, a, b); printf("%" PRId64 "\n", p); } -- cgit v1.3