aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc/call.c
diff options
context:
space:
mode:
authorSimon Busch <morphis@gravedo.de>2012-09-09 13:29:34 +0200
committerSimon Busch <morphis@gravedo.de>2012-09-09 13:29:34 +0200
commit43adc7224042c4fb5ea9a719c0d5799a97ab451a (patch)
treeb7d837af3d2c2f2349139e70073f756b84e994ac /samsung-ipc/call.c
parent3a9c878ca37442aca10917306fffb625c46b0ec4 (diff)
downloadexternal_libsamsung-ipc-43adc7224042c4fb5ea9a719c0d5799a97ab451a.zip
external_libsamsung-ipc-43adc7224042c4fb5ea9a719c0d5799a97ab451a.tar.gz
external_libsamsung-ipc-43adc7224042c4fb5ea9a719c0d5799a97ab451a.tar.bz2
call: fix retrieval of the number of a call
Diffstat (limited to 'samsung-ipc/call.c')
-rw-r--r--samsung-ipc/call.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/samsung-ipc/call.c b/samsung-ipc/call.c
index 5173dfc..77c3325 100644
--- a/samsung-ipc/call.c
+++ b/samsung-ipc/call.c
@@ -96,15 +96,16 @@ char* ipc_call_list_response_get_entry_number(struct ipc_message_info *response,
if (num > count)
return NULL;
- for (n = 0; n < num; n++)
+ for (n = 0; n < num + 1; n++)
{
+ if (entry != NULL)
+ pos += entry->number_len;
+
entry = (struct ipc_call_list_entry*) (response->data + pos);
- pos += (unsigned int) (sizeof(struct ipc_call_list_entry) + entry->number_len);
+ pos += (unsigned int) sizeof(struct ipc_call_list_entry);
}
- if (entry == NULL ||
- (unsigned char*) (response->data + pos) == NULL ||
- (unsigned char*) (response->data + pos + entry->number_len) == NULL)
+ if (entry == NULL || (unsigned char*) (response->data + pos) == NULL)
return NULL;
number = (char*) malloc(sizeof(char) * entry->number_len);