Forgot to reset the offset to 0 when opening a custom file
This commit is contained in:
2023-11-12 14:36:15 +01:00
parent cbf2e053c4
commit 34c0beb43d

View File

@@ -99,6 +99,7 @@ void* tftp_open(const char* fname, const char* mode, u8_t write) {
LOG_INFO(TAG, "Opening %s", fname);
if (strcmp(fname, virt_file[0].name) == 0 && write == TFTP_READ) {
tftp_custom_fseek(&virt_file[0], 0, SEEK_SET);
return &virt_file[0];
} else if (strcmp(fname, virt_file[1].name) == 0 && write != TFTP_READ) {
return &virt_file[1];