소스 검색

fix: prevent segfault by initializing cwd to nullptr

IllusionMan1212 5 달 전
부모
커밋
7d041cb2b8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/path.cpp

+ 1 - 1
src/path.cpp

@@ -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);