we need the null terminator to be present by default
This commit is contained in:
@@ -45,6 +45,7 @@ fn String stringChunkToString(Arena* a, StringChunkList list) {
|
|||||||
.capacity = list.total_size + 1,
|
.capacity = list.total_size + 1,
|
||||||
.bytes = arenaAllocArray(a, u8, list.total_size+1),
|
.bytes = arenaAllocArray(a, u8, list.total_size+1),
|
||||||
};
|
};
|
||||||
|
MemoryZero(result.bytes, result.capacity);
|
||||||
// copy the string bytes out of the StringChunkList into the correctly-sized String
|
// copy the string bytes out of the StringChunkList into the correctly-sized String
|
||||||
StringChunk* chunk = list.first;
|
StringChunk* chunk = list.first;
|
||||||
for (u32 i = 0; i < list.total_size; i++) {
|
for (u32 i = 0; i < list.total_size; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user