diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2013-06-25 22:18:41 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2013-06-25 22:18:41 +0200 |
commit | c9dfae7a17ea4e5a2e114df331942f70d48bfe5b (patch) | |
tree | ecb078dd2e97ec1f2d56ae99da54f6d3028015d1 /samsung-ipc/gprs.c | |
parent | 0e0c698a13ae658640af085591b809bbc9a6f658 (diff) | |
download | external_libsamsung-ipc-c9dfae7a17ea4e5a2e114df331942f70d48bfe5b.zip external_libsamsung-ipc-c9dfae7a17ea4e5a2e114df331942f70d48bfe5b.tar.gz external_libsamsung-ipc-c9dfae7a17ea4e5a2e114df331942f70d48bfe5b.tar.bz2 |
Refactor code for consistent coding style and avoid using assert
Change-Id: Idca5edb70869e07d35744301b185df02e42f5b4c
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc/gprs.c')
-rw-r--r-- | samsung-ipc/gprs.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/samsung-ipc/gprs.c b/samsung-ipc/gprs.c index bb87674..59b5c97 100644 --- a/samsung-ipc/gprs.c +++ b/samsung-ipc/gprs.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of libsamsung-ipc. * * Copyright (C) 2011 Simon Busch <morphis@gravedo.de> @@ -18,10 +18,10 @@ * */ -#include <samsung-ipc.h> -#include <string.h> #include <stdlib.h> -#include <assert.h> +#include <string.h> + +#include <samsung-ipc.h> void ipc_gprs_port_list_setup(struct ipc_gprs_port_list *message) { @@ -30,7 +30,8 @@ void ipc_gprs_port_list_setup(struct ipc_gprs_port_list *message) 0x02, 0x04, 0x16, 0x00, 0x17, 0x00, 0x87, 0x00, 0xBD, 0x01 }; - assert(message != NULL); + if (message == NULL) + return; memset(message, 0, sizeof(struct ipc_gprs_port_list)); @@ -40,7 +41,8 @@ void ipc_gprs_port_list_setup(struct ipc_gprs_port_list *message) void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context *message, unsigned char cid, int enable, char *apn) { - assert(message != NULL); + if (message == NULL) + return; memset(message, 0, sizeof(struct ipc_gprs_define_pdp_context)); @@ -54,7 +56,8 @@ void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context *messa void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context_set *message, unsigned char cid, int enable, char *username, char *password) { - assert(message != NULL); + if (message == NULL) + return; memset(message, 0, sizeof(struct ipc_gprs_pdp_context_set)); @@ -65,8 +68,8 @@ void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context_set *message, { message->unk0[2] = 0x13; message->unk2 = 0x1; - strncpy((char*)message->username, username, 32); - strncpy((char*)message->password, password, 32); + strncpy((char *) message->username, username, 32); + strncpy((char *) message->password, password, 32); } } |