From 000a983b2b23b3e1e0e442960f0bc14c57c27d67 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 14 Jul 2009 13:09:00 -0500 Subject: Make sure record length is not zero Record length can be reported as 0 by the driver if it is for a a binary (non-record based) file. Set it to the file length in this case --- src/sim.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/sim.c b/src/sim.c index 0daf586f..ab48b784 100644 --- a/src/sim.c +++ b/src/sim.c @@ -386,7 +386,12 @@ static void sim_op_info_cb(const struct ofono_error *error, int length, op->structure = structure; op->length = length; - op->record_length = record_length; + + if (structure == OFONO_SIM_FILE_STRUCTURE_TRANSPARENT) + op->record_length = length; + else + op->record_length = record_length; + op->current = 1; g_timeout_add(0, sim_op_retrieve_next, modem); -- cgit v1.2.3