Skip to content

Commit 09ca6e5

Browse files
committed
[fix] allocation size in test
1 parent 04fa675 commit 09ca6e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ TEST test_latin1_to_utf8(void) {
1616
char *data = aligned_malloc(len, 32);
1717
memcpy(data, data_str, len);
1818
size_t utf8_output_len = len + 1;
19-
char *utf8_output = aligned_malloc(utf8_output_len, 32);
19+
char *utf8_output = aligned_malloc(utf8_output_len + 1, 32);
2020

2121
utf_result_t converted = convert_latin1_to_utf8(data, len, utf8_output, utf8_output_len);
2222
ASSERT_EQ(converted.return_code, SIMDUTF_SUCCESS);
@@ -30,7 +30,7 @@ TEST test_latin1_to_utf8(void) {
3030
memcpy(data_long, data_str_long, len_long);
3131

3232
size_t utf8_output_len_long = len_long + 4;
33-
char *utf8_output_long = aligned_malloc(utf8_output_len_long, 32);
33+
char *utf8_output_long = aligned_malloc(utf8_output_len_long + 1, 32);
3434

3535
utf_result_t converted_long = convert_latin1_to_utf8(data_long, len_long, utf8_output_long, utf8_output_len_long);
3636
ASSERT_EQ(converted_long.return_code, SIMDUTF_SUCCESS);

0 commit comments

Comments
 (0)