Chris Solomon

Bug Report: In MQX 4.1 _io_mfs_read & _io_mfs_write do not advance the file location

Discussion created by Chris Solomon on Sep 16, 2014
Latest reply on Sep 17, 2014 by Chris Solomon

Hi,

I believe I have found a bug in MFS (shipped with MQX 4.1.0.1).

 

In MFS shipped with MQX 4.0.1 the call to MFS_Read and MFS_Write is made with the file pointer, and the location is advanced as it should be.

In MFS shipped with MQX 4.1.0.1 the call to MFS_Read and MFS_Write is made using the MFS_HANDLE pointer, which contains a different location (which is updated), but the location in the file pointer is not.

 

This breaks the ftell functionality.

 

Proposed fix:

Add the following line of code:

file_ptr->LOCATION = handle->LOCATION;

 

at line 710 and 811 of mfs_init.c

 

This seems to fix the problem for me.

 

Thanks

 

Chris

Outcomes