In case comparing whole string, use strcmp().
Change-Id: Iacb667cacece5eb8a964c8dc2219ff0d17908bf3
if (!extension) {
if (file_info->mime_type
- && strncmp(file_info->mime_type, "application/x-xz", strlen("application/x-xz"))
- && strncmp(file_info->mime_type, "application/rss+xml", strlen("application/rss+xml")))
+ && strcmp(file_info->mime_type, "application/x-xz")
+ && strcmp(file_info->mime_type, "application/rss+xml"))
extension = __get_extension_name(file_info->mime_type, file_name_from_header, url);
else
extension = __get_extension_name(NULL, file_name_from_header, url);
goto ERR;
}
- if (origin_ETag && new_ETag &&
- 0 != strncmp(origin_ETag, new_ETag, strlen(new_ETag))) {
+ if (origin_ETag && new_ETag && strcmp(origin_ETag, new_ETag)) {
DA_LOGE("ETag is not identical! revoke!");
/* FIXME Later : Need to detail error exception handling */
ret = DA_ERR_NETWORK_FAIL;
DA_LOGE("Fail to raf mode value from response header");
} else {
DA_LOGI("[RAF] val[%s:%s]", HTTP_FIELD_RAF_MODE, val);
- if (strncmp(val, "yes", strlen("yes")) == 0) {
+ if (strcmp(val, "yes") == 0) {
DA_MUTEX_LOCK(&(http_info->mutex_state));
http_info->state = HTTP_STATE_DOWNLOAD_STARTED;
DA_MUTEX_UNLOCK(&(http_info->mutex_state));
b_ret = __get_http_header_for_field(http_msg_response,
HTTP_FIELD_CONTENT_TYPE, &header);
if (b_ret) {
- if (header->raw_value && (!strncmp(header->raw_value, in_type,
- strlen(header->raw_value))))
+ if (header->raw_value && !strcmp(header->raw_value, in_type))
return;
DA_SECURE_LOGD("exchange Content-Type to [%s] from [%s]", in_type, header->value);
int index = 0;
int list_size = sizeof(ambiguous_MIME_Type_list) / sizeof(const char *);
for (index = 0 ; index < list_size ; index++) {
- if (0 == strncmp(in_mime_type, ambiguous_MIME_Type_list[index],
- strlen(ambiguous_MIME_Type_list[index]))) {
+ if (0 == strcmp(in_mime_type, ambiguous_MIME_Type_list[index])) {
//DA_SECURE_LOGD("It is ambiguous! [%s]", ambiguous_MIME_Type_list[index]);
return DA_TRUE;
}
DA_LOGV("No extension list");
#ifdef _SAMSUNG_MIME_POLICY
for (i = 0; i < MAX_SEC_MIME_TABLE_INDEX; i++) {
- if (strncmp(sec_mime_table[i].mime, mime, strlen(mime)) == 0) {
+ if (strcmp(sec_mime_table[i].mime, mime) == 0) {
strncpy(ext_temp, sec_mime_table[i].ext, DA_MAX_STR_LEN-1);
ret = DA_RESULT_OK;
break;
* try to search common extension name from table
* with first mime type at extension list*/
for (i = 0; i < MAX_EXT_TABLE_INDEX; i++) {
- if (strncmp(ext_trans_table[i].standard, *extlist,
- strlen(*extlist)) == 0) {
+ if (strcmp(ext_trans_table[i].standard, *extlist) == 0) {
memset(ext_temp, 0x00, DA_MAX_STR_LEN);
strncpy(ext_temp, ext_trans_table[i].normal, DA_MAX_STR_LEN-1);
break;
if (strlen(ext_temp) < 1) {
/* If there is no mime string for OMA descriptor mime type */
- if (strncmp(DD_MIME_STR, mime, strlen(DD_MIME_STR)) == 0) {
+ if (strcmp(DD_MIME_STR, mime) == 0) {
strncpy(ext_temp, DD_EXT_STR, DA_MAX_STR_LEN - 1);
ret = DA_RESULT_OK;
/* If there is no extension name for "applicaion/vnd.oma.drm.messeages"
* at shared-mime-info*/
- } else if (strncmp(DRM_MIME_MSG_STR, mime, strlen(DRM_MIME_MSG_STR)) ==
- 0) {
+ } else if (strcmp(DRM_MIME_MSG_STR, mime) == 0) {
strncpy(ext_temp, DRM_EXT_STR, DA_MAX_STR_LEN - 1);
/* If there is extension name at extlist, the return value can have an error.*/
ret = DA_RESULT_OK;
}
// FIXME later : check status code and redirection case check.
-
- if (strncmp(msg, HTTP_FIELD_END_OF_FIELD,
- strlen(HTTP_FIELD_END_OF_FIELD)) == 0) {
+ if (strcmp(msg, HTTP_FIELD_END_OF_FIELD) == 0) {
long status = 0;
CURLcode res;
CURL *curl;
int index = 0;
int listSize = sizeof(ambiguous_mime_type_list) / sizeof(const char *);
for (index = 0; index < listSize; index++) {
- if (0 == strncmp(mime_type, ambiguous_mime_type_list[index],
- strlen(ambiguous_mime_type_list[index]))) {
+ if (0 == strcmp(mime_type, ambiguous_mime_type_list[index])) {
TRACE_DEBUG("It is ambiguous");
return 0;
}
/* Search a content type from mime table. */
for (i = 0; i < DP_MAX_MIME_TABLE_NUM; i++) {
- if (strncmp(mime_table[i].mime, temp_mime, strlen(temp_mime)) == 0) {
+ if (strcmp(mime_table[i].mime, temp_mime) == 0) {
type = mime_table[i].content_type;
break;
}