From: ashish.cb Date: Wed, 26 Jul 2017 10:43:57 +0000 (+0530) Subject: Fixed minor issues X-Git-Tag: accepted/tizen/4.0/unified/20170828.223838~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F140804%2F1;p=platform%2Fcore%2Fappfw%2Fdata-control.git Fixed minor issues Change-Id: I6e8ffd6c53d8754aa067d3687a62015be67f1dc5 --- diff --git a/src/data_control_internal.c b/src/data_control_internal.c index 2c78d78..f0b8b5c 100755 --- a/src/data_control_internal.c +++ b/src/data_control_internal.c @@ -592,7 +592,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, } if (size > 0 && size < MAX_REQUEST_ARGUMENT_SIZE) { - value = (void *)malloc(sizeof(void) * size); + value = (void *)malloc(sizeof(char) * size); if (value == NULL) { _LOGE("Out of mememory"); retval = DATA_CONTROL_ERROR_IO_ERROR; @@ -606,7 +606,7 @@ static int __recv_sql_select_process(bundle *kb, int fd, goto out; } _LOGE("value : %s", (char *)value); - if (write(result_fd, value, sizeof(void) * size) == -1) { + if (write(result_fd, value, sizeof(char) * size) == -1) { _LOGE("Writing a value to a file descriptor is failed. errno = %d", errno); retval = DATA_CONTROL_ERROR_IO_ERROR; goto out; diff --git a/src/data_control_provider.c b/src/data_control_provider.c index f2ea2ae..9c0c6d6 100755 --- a/src/data_control_provider.c +++ b/src/data_control_provider.c @@ -997,7 +997,7 @@ static int __send_select_result(int fd, bundle *b, void *data) return DATA_CONTROL_ERROR_IO_ERROR; buf_len = sizeof(int) * 2 + size; - buf = calloc(buf_len, sizeof(void)); + buf = calloc(buf_len, sizeof(char)); if (buf == NULL) { _LOGE("calloc failed"); return DATA_CONTROL_ERROR_OUT_OF_MEMORY; @@ -2277,7 +2277,6 @@ EXPORT_API char *data_control_provider_create_insert_statement( set_last_result(DATA_CONTROL_ERROR_OUT_OF_MEMORY); return NULL; } - memset(sql, 0, sql_len); snprintf(sql, sql_len, "INSERT INTO %s (", data_id); free(data_id); @@ -2337,7 +2336,6 @@ EXPORT_API char *data_control_provider_create_delete_statement( set_last_result(DATA_CONTROL_ERROR_OUT_OF_MEMORY); return NULL; } - memset(sql, 0, sql_len); snprintf(sql, sql_len, "DELETE FROM %s", data_id); if (where) { @@ -2408,7 +2406,6 @@ EXPORT_API char *data_control_provider_create_update_statement( set_last_result(DATA_CONTROL_ERROR_OUT_OF_MEMORY); return NULL; } - memset(sql, 0, sql_len); snprintf(sql, sql_len, "UPDATE %s SET ", data_id); free(data_id); @@ -2484,7 +2481,6 @@ EXPORT_API char *data_control_provider_create_select_statement( set_last_result(DATA_CONTROL_ERROR_OUT_OF_MEMORY); return NULL; } - memset(sql, 0, sql_len); strncpy(sql, "SELECT ", sql_len); if (!column_list) {