summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-15 23:19:05 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-15 23:19:05 +0200
commit3ac8a06e1c5273190cb521d48a0aae9636203cba (patch)
treed064be1c61796fc5934e9d1bf80091a64f22da9c
parentba7bf1ad5b9d6e5ceab6854eec9bfa09f9be2d85 (diff)
downloadkit-3ac8a06e1c5273190cb521d48a0aae9636203cba.zip
test
-rw-r--r--source/kit/file.c6
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);