string16 improvements

This commit is contained in:
Krzosa Karol
2025-04-04 08:25:47 +02:00
parent f6d5a1cf81
commit f3aa52ba3d
34 changed files with 637 additions and 699 deletions

View File

@@ -45,7 +45,7 @@ fn s8_t os_exe(ma_arena_t *arena) {
ssize_t size = readlink("/proc/self/exe", buffer, buffer_size);
assert(size < buffer_size); // @todo:?
assert(size != -1);
s8_t string = s8_copy(arena, s8(buffer, size));
s8_t string = s8_copy(arena, s8_make(buffer, size));
ma_end_scratch(temp);
return string;
}
@@ -122,7 +122,7 @@ fn s8_t os_read(ma_arena_t *arena, s8_t path) {
fread(string, size, 1, fd);
fclose(fd);
result = s8(string, size);
result = s8_make(string, size);
result.str[result.len] = 0;
}
ma_end_scratch(temp);