From cd36234f45b2fba0d44a7bd626d1e0bbd6d9d4bb Mon Sep 17 00:00:00 2001 From: "seungha.son" Date: Mon, 28 Nov 2016 19:14:13 +0900 Subject: Adjust coding rule Signed-off-by: seungha.son Change-Id: If6dc6aa686e0d3c6bf81490c9924ef5f4ea12d8c --- src/notification_setting_service.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/notification_setting_service.c b/src/notification_setting_service.c index ebd6347..9c596ee 100644 --- a/src/notification_setting_service.c +++ b/src/notification_setting_service.c @@ -34,7 +34,7 @@ static int _get_table_field_data_int(char **table, int *buf, int index) { - if ((table == NULL) || (buf == NULL) || (index < 0)) { + if (table == NULL || buf == NULL || index < 0) { /* LCOV_EXCL_START */ NOTIFICATION_ERR("table[%p], buf[%p], index[%d]", table, buf, index); return false; @@ -55,22 +55,24 @@ static int _get_table_field_data_int(char **table, int *buf, int index) static int _get_table_field_data_string(char **table, char **buf, int ucs2, int index) { int ret = false; + int sLen = 0; + char *pTemp; - if ((table == NULL) || (buf == NULL) || (index < 0)) { + if (table == NULL || buf == NULL || index < 0) { /* LCOV_EXCL_START */ NOTIFICATION_ERR("table[%p], buf[%p], index[%d]", table, buf, index); return false; /* LCOV_EXCL_STOP */ } - char *pTemp = table[index]; - int sLen = 0; + pTemp = table[index]; + if (pTemp == NULL) { *buf = NULL; /* LCOV_EXCL_LINE */ } else { sLen = strlen(pTemp); if (sLen) { - *buf = (char *) malloc(sLen + 1); + *buf = (char *)malloc(sLen + 1); if (*buf == NULL) { NOTIFICATION_ERR("malloc is failed"); /* LCOV_EXCL_LINE */ goto out; -- cgit v1.2.3