mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
fix: prevent segfault by initializing cwd to nullptr
This commit is contained in:
+1
-1
@@ -81,7 +81,7 @@ String get_working_directory(gbAllocator allocator) {
|
|||||||
auto buf = array_make<char>(temporary_allocator());
|
auto buf = array_make<char>(temporary_allocator());
|
||||||
size_t size = PATH_MAX;
|
size_t size = PATH_MAX;
|
||||||
|
|
||||||
char const *cwd;
|
char const *cwd = nullptr;
|
||||||
for (; cwd == nullptr; size *= 2) {
|
for (; cwd == nullptr; size *= 2) {
|
||||||
array_resize(&buf, size);
|
array_resize(&buf, size);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user