diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-09-15 23:19:05 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-09-15 23:19:05 +0200 |
commit | 3ac8a06e1c5273190cb521d48a0aae9636203cba (patch) | |
tree | d064be1c61796fc5934e9d1bf80091a64f22da9c /source | |
parent | ba7bf1ad5b9d6e5ceab6854eec9bfa09f9be2d85 (diff) | |
download | kit-3ac8a06e1c5273190cb521d48a0aae9636203cba.zip |
test
Diffstat (limited to 'source')
-rw-r--r-- | source/kit/file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/kit/file.c b/source/kit/file.c index b2167c7..cb64fe5 100644 --- a/source/kit/file.c +++ b/source/kit/file.c @@ -442,8 +442,7 @@ kit_path_list_t kit_folder_enum(kit_str_t path, printf(" ENUM %s \n", data.cFileName); fflush(stdout); - i64 size = 0; - while (size < MAX_PATH && data.cFileName[size] != '\0') size++; + i64 size = (i64) strlen(data.cFileName); printf(" size %d \n", (int) size); DA_INIT(result.files.values[n], size, alloc); if (result.files.values[n].size != size) { @@ -452,8 +451,7 @@ kit_path_list_t kit_folder_enum(kit_str_t path, break; } - for (i64 i = 0; i < size; i++) - result.files.values[n].values[i] = data.cFileName[i]; + memcpy(result.files.values[n].values, data.cFileName, size); } while (FindNextFileA(find, &data) != 0); FindClose(find); |