Hi Slava,

On 7/30/21 7:07 AM, Slava Monich wrote:
---
  src/simfs.c | 17 ++++++++---------
  1 file changed, 8 insertions(+), 9 deletions(-)


Funny how long this bug has been lurking around.

diff --git a/src/simfs.c b/src/simfs.c
index 3d4f6283..cf770265 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -383,18 +383,18 @@ static void sim_fs_op_read_block_cb(const struct 
ofono_error *error,
        }
start_block = op->offset / 256;
-       end_block = (op->offset + (op->num_bytes - 1)) / 256;
+       end_block = op->num_bytes ? (op->offset + op->num_bytes - 1) / 256 :
+                                                               start_block;

Curious why this is needed? op->num_bytes should never be zero since it gets set to the file length?

Rest looks good to me.

Regards,
-Denis
_______________________________________________
ofono mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to