summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-07-14 13:09:00 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-07-14 15:45:06 -0500
commit000a983b2b23b3e1e0e442960f0bc14c57c27d67 (patch)
tree50b6a1c81d506b60f7d762811511040c745b76f0
parent864e09481ccb0ccb42ef4fd4147b328b3b486a67 (diff)
downloadofono-000a983b2b23b3e1e0e442960f0bc14c57c27d67.tar.bz2
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
-rw-r--r--src/sim.c7
1 files changed, 6 insertions, 1 deletions
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);