diff options
-rw-r--r-- | samsung-ipc/call.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/samsung-ipc/call.c b/samsung-ipc/call.c index 5b725ad..2f13ba3 100644 --- a/samsung-ipc/call.c +++ b/samsung-ipc/call.c @@ -30,10 +30,16 @@ void ipc_call_outgoing_setup(struct ipc_call_outgoing *message, unsigned char ty { assert(message != NULL); + memset(message, 0, sizeof(struct ipc_call_outgoing)); + message->type = type; message->identity = identity; message->prefix = prefix; - strncpy(message->number, number, OUTGOING_NUMBER_MAX_LENGTH); + message->length = strlen(number); + + assert(message->length <= OUTGOING_NUMBER_MAX_LENGTH); + + strncpy(message->number, number, message->length); } /** |