Fixed an AST bug

This commit is contained in:
2024-07-20 16:27:07 +10:00
parent b77f0fb50d
commit 2ce9a0cf42
3 changed files with 9 additions and 9 deletions

View File

@@ -455,8 +455,8 @@ static void printToBuffer(const char* str) {
globalPrintBuffer = TOY_GROW_ARRAY(char, globalPrintBuffer, oldCapacity, globalPrintCapacity);
}
snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str ? str : "\0");
globalPrintCount += strlen(str);
size_t total = snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str ? str : "");
globalPrintCount += total;
}
//exposed functions