diff --git a/project/Core/Src/tftp.c b/project/Core/Src/tftp.c index a467be6..2796715 100644 --- a/project/Core/Src/tftp.c +++ b/project/Core/Src/tftp.c @@ -147,10 +147,10 @@ int tftp_read(void* handle, void* buf, int bytes) { } FILE* file = (FILE*)handle; - if (file == &virt_file[0]) { - ret = tftp_custom_fread(buf, bytes, file); + if ((tftp_custom_file_t*)file == &virt_file[0]) { + ret = tftp_custom_fread(buf, bytes, (tftp_custom_file_t*)file); return ret; - } else if (file == &virt_file[1]) { + } else if ((tftp_custom_file_t*)file == &virt_file[1]) { LOG_CRIT(TAG, "Exception: Trying to read a write only file"); return -1; }