Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanplusplus committed Jan 12, 2025
1 parent 154c7a5 commit e11ed2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exercises/practice/roman-numerals/.meta/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <string.h>

#define NUM_OF_ELEMENTS(a) (sizeof(a) / sizeof(a[0]))
#define MAX_NUMERAL_LENGTH (10)
#define MAX_NUMERAL_LENGTH (16)

typedef struct {
char *numeral;
Expand All @@ -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) {
Expand Down

0 comments on commit e11ed2f

Please sign in to comment.