fs Fetch cleanup

This commit is contained in:
2025-10-03 20:03:03 +02:00
parent c30d2d2ea6
commit dc8df7fade

View File

@ -44,14 +44,22 @@ void fs_fetch(void) {
IoctlDirent *dirent = &dirents[i];
char membuf[20];
uprintf("%-30s %-15s %-1s",
dirent->name,
dirent->stat.type == IOCTLSTAT_FILE ? human_size(dirent->stat.size, membuf, 20) : "-",
dirent->stat.type == IOCTLSTAT_FILE ? "F" : "D"
);
uprintf("\n");
if (dirent->stat.type == IOCTLSTAT_FILE) {
char *membuf = umalloc(20);
uprintf("%-30s %-15s %-1s\n",
dirent->name,
human_size(dirent->stat.size, membuf, 20),
"F"
);
ufree(membuf);
} else if (dirent->stat.type == IOCTLSTAT_DIR) {
uprintf("%-30s %-15s %-1s\n",
dirent->name,
"-",
"D"
);
}
}
ufree(dirents);