return TRUE;
}
-
while(sqlite3_step(sql_stmt) == SQLITE_ROW) {
DcmScanItem *scan_item = (DcmScanItem *) g_malloc0(sizeof(DcmScanItem));
if (!scan_item) {
scan_item->image_width = sqlite3_column_int(sql_stmt, 2);
scan_item->image_height = sqlite3_column_int(sql_stmt, 3);
scan_item->image_orientation = sqlite3_column_int(sql_stmt, 4);
- if (DCM_STRING_VALID((const char *)sqlite3_column_text(sql_stmt, 5)))
- scan_item->mime_type = strdup((const char *)sqlite3_column_text(sql_stmt, 5));
+ scan_item->mime_type = g_strdup((const char *)sqlite3_column_text(sql_stmt, 5));
/* scan item retrieved by this function will be marked as SCAN_SINGLE */
scan_item->scan_item_type = DCM_SCAN_ITEM_TYPE_SCAN_SINGLE;
dcm_sec_debug("media uuid: [%s] file path: [%s]", scan_item->media_uuid, scan_item->file_path);
}
-
DCM_SQLITE3_FINALIZE(sql_stmt);
scan_item->image_width = sqlite3_column_int(sql_stmt, 3);
scan_item->image_height = sqlite3_column_int(sql_stmt, 4);
scan_item->image_orientation = sqlite3_column_int(sql_stmt, 5);
- if (DCM_STRING_VALID((const char *)sqlite3_column_text(sql_stmt, 6)))
- scan_item->mime_type = strdup((const char *)sqlite3_column_text(sql_stmt, 6));
+ scan_item->mime_type = g_strdup((const char *)sqlite3_column_text(sql_stmt, 6));
/* scan item retrieved by this function will be marked as SCAN_ALL */
scan_item->scan_item_type = DCM_SCAN_ITEM_TYPE_SCAN_ALL;
uuid_generate(uuid_value);
uuid_unparse(uuid_value, uuid_unparsed);
- (*face)->face_uuid = strdup(uuid_unparsed);
+ (*face)->face_uuid = g_strdup(uuid_unparsed);
if ((*face)->face_uuid == NULL) {
ret = DCM_ERROR_UUID_GENERATE_FAILED;
send_msg.result = (int)result;
if (msg != NULL) {
send_msg.msg_size = strlen(msg);
- strncpy(send_msg.msg, msg, send_msg.msg_size);
+ g_strlcpy(send_msg.msg, msg, DCM_IPC_MSG_MAX_SIZE);
}
/* If message size is larget than max_size, then message is invalid */
send_msg.uid = uid;
if (msg != NULL) {
send_msg.msg_size = strlen(msg);
- strncpy(send_msg.msg, msg, send_msg.msg_size);
+ g_strlcpy(send_msg.msg, msg, DCM_IPC_MSG_MAX_SIZE);
}
/* If message size is larget than max_size, then message is invalid */
send_msg.result = count;
if (msg != NULL) {
send_msg.msg_size = strlen(msg);
- strncpy(send_msg.msg, msg, send_msg.msg_size);
+ g_strlcpy(send_msg.msg, msg, DCM_IPC_MSG_MAX_SIZE);
}
/* If message size is larget than max_size, then message is invalid */