Fixed potential warnings in the arena allocator

This commit is contained in:
Eric-Paul Ickhorn 2024-01-19 21:30:43 +01:00
parent dcbd9555d5
commit 545295af9d
Signed by: epickh
GPG Key ID: F5EBBE013924D95F
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,8 @@
#include <alloc/arena.h>
#include <librr/alloc/arena.h>
#include <librr/strutil.h>
#include <librr/memory.h>
#include <stdlib.h>
rr_arena_s rr_new_arena(usz_t capacity)
{
@ -28,7 +32,7 @@ void * rr_arena_alloc(rr_arena_s *arena, usz_t length)
return block;
}
char * rr_arena_clone_string(rr_arena_s *arena, char *string)
char * rr_arena_clone_string(rr_arena_s *arena, const char *string)
{
usz_t len_string = rr_measure_string(string);
char *cloned_string = rr_arena_alloc(arena, len_string+1);