Skip to content

Commit

Permalink
Fix tests on g++
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-s committed Feb 13, 2023
1 parent fdc60f8 commit 6d04c70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hpy/devel/src/runtime/format.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ typedef struct {
static void StrWriter_Init(StrWriter *writer, HPy_ssize_t init_size)
{
memset(writer, 0, sizeof(*writer));
writer->data_utf8 = malloc(init_size);
writer->data_utf8 = (char*) malloc(init_size);
writer->size = init_size;
}

Expand All @@ -194,7 +194,7 @@ static bool StrWriter_EnsureSpace(StrWriter *writer, HPy_ssize_t len)
if (writer->size < 0)
writer->size = HPY_SSIZE_T_MAX;
char *prev = writer->data_utf8;
writer->data_utf8 = realloc(writer->data_utf8, writer->size);
writer->data_utf8 = (char*) realloc(writer->data_utf8, writer->size);
if (!writer->data_utf8) {
free(prev);
writer->memory_error = true;
Expand Down

0 comments on commit 6d04c70

Please sign in to comment.