fat32: Fix bug with conversion to 8+3 filename

This commit is contained in:
mintsuki 2021-02-08 19:06:10 +01:00
parent c373a734c5
commit 898407760f
4 changed files with 4 additions and 3 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -167,6 +167,9 @@ static bool fat32_filename_to_8_3(char *dest, const char *src) {
int i = 0, j = 0;
bool ext = false;
for (size_t i = 0; i < 8+3; i++)
dest[i] = ' ';
while (src[i]) {
if (src[i] == '.') {
if (ext) {
@ -174,9 +177,7 @@ static bool fat32_filename_to_8_3(char *dest, const char *src) {
return false;
}
ext = true;
// Pad the rest of the base filename with spaces
while (j < 8)
dest[j++] = ' ';
j = 8;
i++;
continue;
}