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/misc.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/misc.c')
-rw-r--r-- | samsung-ipc/misc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/samsung-ipc/misc.c b/samsung-ipc/misc.c index 96798cf..9241453 100644 --- a/samsung-ipc/misc.c +++ b/samsung-ipc/misc.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of libsamsung-ipc. * * Copyright (C) 2011 Simon Busch <morphis@gravedo.de> @@ -17,19 +17,21 @@ * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>. * */ +#include <stdlib.h> +#include <string.h> #include <samsung-ipc.h> -#include <string.h> -#define DEFAULT_IMSI_LENGTH 15 +#define DEFAULT_IMSI_LENGTH 15 -char* ipc_misc_me_imsi_response_get_imsi(struct ipc_message_info *response) +char *ipc_misc_me_imsi_response_get_imsi(struct ipc_message_info *response) { if (response == NULL || response->data[0] != DEFAULT_IMSI_LENGTH) return NULL; - char *buffer = (char*) malloc(sizeof(char) * DEFAULT_IMSI_LENGTH); + char *buffer = (char *) malloc(sizeof(char) * DEFAULT_IMSI_LENGTH); memcpy(buffer, &response->data[1], DEFAULT_IMSI_LENGTH); + return buffer; } |