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/032_invertmoves/invertmoves_tests.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/032_invertmoves') diff --git a/test/032_invertmoves/invertmoves_tests.c b/test/032_invertmoves/invertmoves_tests.c index d5da323..d791524 100644 --- a/test/032_invertmoves/invertmoves_tests.c +++ b/test/032_invertmoves/invertmoves_tests.c @@ -3,8 +3,8 @@ #define MAXMOVES 20 int64_t readmoves(const char *, int, uint8_t *); -void writemoves(uint8_t *, int, uint64_t, char *); -void invertmoves(uint8_t *, uint8_t, uint8_t *); +void writemoves(size_t n, uint8_t [n], size_t m, char [m]); +void invertmoves(size_t n, const uint8_t [n], uint8_t [n]); void run(void) { char movestr[STRLENMAX], outstr[STRLENMAX]; @@ -14,8 +14,8 @@ void run(void) { fgets(movestr, STRLENMAX, stdin); c = readmoves(movestr, MAXMOVES, moves); - invertmoves(moves, c, ret); - writemoves(ret, c, STRLENMAX, outstr); + invertmoves(c, moves, ret); + writemoves(c, ret, STRLENMAX, outstr); printf("%s\n", outstr); } -- cgit v1.3