fix: prevent segfault by initializing cwd to nullptr

This commit is contained in:
IllusionMan1212
2025-04-04 05:14:52 +02:00
parent 1a91aa0d43
commit 7d041cb2b8

View File

@@ -81,7 +81,7 @@ String get_working_directory(gbAllocator allocator) {
auto buf = array_make<char>(temporary_allocator());
size_t size = PATH_MAX;
char const *cwd;
char const *cwd = nullptr;
for (; cwd == nullptr; size *= 2) {
array_resize(&buf, size);