From e11ed2fce9564b15d62a2baab681e566fce297a6 Mon Sep 17 00:00:00 2001 From: Ryan Hartlage Date: Sun, 12 Jan 2025 09:32:51 -0500 Subject: [PATCH] Fix tests --- exercises/practice/roman-numerals/.meta/example.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/practice/roman-numerals/.meta/example.c b/exercises/practice/roman-numerals/.meta/example.c index 4f49e79fc..f7f160d0f 100644 --- a/exercises/practice/roman-numerals/.meta/example.c +++ b/exercises/practice/roman-numerals/.meta/example.c @@ -3,7 +3,7 @@ #include #define NUM_OF_ELEMENTS(a) (sizeof(a) / sizeof(a[0])) -#define MAX_NUMERAL_LENGTH (10) +#define MAX_NUMERAL_LENGTH (16) typedef struct { char *numeral; @@ -18,7 +18,7 @@ const numeral_values_t numeral_values[] = { char *to_roman_numeral(unsigned int number) { - char *numerals = calloc(sizeof(char), MAX_NUMERAL_LENGTH); + char *numerals = calloc(1, sizeof(char) * (MAX_NUMERAL_LENGTH)); for (size_t i = 0; i < NUM_OF_ELEMENTS(numeral_values); i++) { while (number >= numeral_values[i].value) {