FPRINTF("[Line : %d][%s] TEST SUIT clean-up: CTs_platform_permission_ContactsService_p\\n", __LINE__, API_NAMESPACE);
#endif
- if( g_bIsConnected || (!g_bIsConnected && ContactsServiceConnect()) )
+ if( g_bIsConnected || ContactsServiceConnect() )
{
contacts_record_destroy(g_hRecordFirst, true);
contacts_record_destroy(g_hFirstProfileRecord, true);
{
memset(FinalPath, 0, PATHLEN);
strncpy(FinalPath, FirstPath, strlen(FirstPath)+1);
- strncat(FinalPath, "/", 1);
+ strncat(FinalPath, "/", strlen("/")+1);
strncat(FinalPath, SecondPath, strlen(SecondPath)+1);
FPRINTF("[Line : %d][%s] Appended Path is : %s\\n", __LINE__, API_NAMESPACE, FinalPath);
pszErrInfo = (char*)calloc(MEMLOG_SIZE, MEMLOG_SIZE * sizeof(char));
switch(nError)
{
- case SYSTEM_INFO_ERROR_PERMISSION_DENIED: strcpy(pszErrInfo,"SYSTEM_INFO_ERROR_PERMISSION_DENIED"); break;
+ case SYSTEM_INFO_ERROR_PERMISSION_DENIED: strncpy(pszErrInfo,"SYSTEM_INFO_ERROR_PERMISSION_DENIED", strlen("SYSTEM_INFO_ERROR_PERMISSION_DENIED")+1); break;
- case SYSTEM_INFO_ERROR_INVALID_PARAMETER: strcpy(pszErrInfo,"SYSTEM_INFO_ERROR_INVALID_PARAMETER"); break;
+ case SYSTEM_INFO_ERROR_INVALID_PARAMETER: strncpy(pszErrInfo,"SYSTEM_INFO_ERROR_INVALID_PARAMETER", strlen("SYSTEM_INFO_ERROR_INVALID_PARAMETER")+1); break;
- case SYSTEM_INFO_ERROR_OUT_OF_MEMORY: strcpy(pszErrInfo,"SYSTEM_INFO_ERROR_OUT_OF_MEMORY"); break;
+ case SYSTEM_INFO_ERROR_OUT_OF_MEMORY: strncpy(pszErrInfo,"SYSTEM_INFO_ERROR_OUT_OF_MEMORY", strlen("SYSTEM_INFO_ERROR_OUT_OF_MEMORY")+1); break;
- case SYSTEM_INFO_ERROR_IO_ERROR: strcpy(pszErrInfo,"SYSTEM_INFO_ERROR_IO_ERROR"); break;
+ case SYSTEM_INFO_ERROR_IO_ERROR: strncpy(pszErrInfo,"SYSTEM_INFO_ERROR_IO_ERROR", strlen("SYSTEM_INFO_ERROR_IO_ERROR")+1); break;
- default: strcpy(pszErrInfo,"Unknown_Error");
+ default: strncpy(pszErrInfo,"Unknown_Error", strlen("Unknown_Error")+1);
}
fprintf(fpLog,"\\n[%s] %s failed , error returned = %s.",API_NAMESPACE, pszApi,pszErrInfo);
pszErrMSG = (char*)calloc(MAX_BLOCK_SIZE, MEMLOG_SIZE * sizeof(char));
switch(nRet)
{
- case SENSOR_ERROR_IO_ERROR : strcpy(pszErrMSG,"SENSOR_ERROR_IO_ERROR"); break;
+ case SENSOR_ERROR_IO_ERROR : strncpy(pszErrMSG,"SENSOR_ERROR_IO_ERROR", strlen("SENSOR_ERROR_IO_ERROR")+1); break;
- case SENSOR_ERROR_INVALID_PARAMETER : strcpy(pszErrMSG,"SENSOR_ERROR_INVALID_PARAMETER"); break;
+ case SENSOR_ERROR_INVALID_PARAMETER : strncpy(pszErrMSG,"SENSOR_ERROR_INVALID_PARAMETER", strlen("SENSOR_ERROR_INVALID_PARAMETER")+1); break;
- case SENSOR_ERROR_OUT_OF_MEMORY : strcpy(pszErrMSG,"SENSOR_ERROR_OUT_OF_MEMORY" ); break;
+ case SENSOR_ERROR_OUT_OF_MEMORY : strncpy(pszErrMSG,"SENSOR_ERROR_OUT_OF_MEMORY", strlen("SENSOR_ERROR_OUT_OF_MEMORY")+1); break;
- case SENSOR_ERROR_NOT_NEED_CALIBRATION : strcpy(pszErrMSG,"SENSOR_ERROR_NOT_NEED_CALIBRATION "); break;
+ case SENSOR_ERROR_NOT_NEED_CALIBRATION : strncpy(pszErrMSG,"SENSOR_ERROR_NOT_NEED_CALIBRATION", strlen("SENSOR_ERROR_NOT_NEED_CALIBRATION")+1); break;
- case SENSOR_ERROR_NOT_SUPPORTED: strcpy(pszErrMSG,"SENSOR_ERROR_NOT_SUPPORTED"); break;
+ case SENSOR_ERROR_NOT_SUPPORTED: strncpy(pszErrMSG,"SENSOR_ERROR_NOT_SUPPORTED", strlen("SENSOR_ERROR_NOT_SUPPORTED")+1); break;
- case SENSOR_ERROR_OPERATION_FAILED : strcpy(pszErrMSG,"SENSOR_ERROR_OPERATION_FAILED"); break;
+ case SENSOR_ERROR_OPERATION_FAILED : strncpy(pszErrMSG,"SENSOR_ERROR_OPERATION_FAILED", strlen("SENSOR_ERROR_OPERATION_FAILED")+1); break;
- case SENSOR_ERROR_PERMISSION_DENIED : strcpy(pszErrMSG,"SENSOR_ERROR_PERMISSION_DENIED"); break;
+ case SENSOR_ERROR_PERMISSION_DENIED : strncpy(pszErrMSG,"SENSOR_ERROR_PERMISSION_DENIED", strlen("SENSOR_ERROR_PERMISSION_DENIED")+1); break;
- default: strcpy(pszErrMSG,"Returned error is UNKNOWN" );
+ default: strncpy(pszErrMSG,"Returned error is UNKNOWN", strlen("Returned error is UNKNOWN")+1);
}
fprintf (fpLog,"\\n[%s] %s is failed, error returned = %s (%d)", API_NAMESPACE, pszApi, pszErrMSG, nRet);
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, strlen(pPath)+1);
FPRINTF( "[Line: %d] [%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, strlen(pAppDataPath)+1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF( "[Line: %d] [%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
}
//Initialize APPID value from configuration file
memset(g_pstrAppId, 0, sizeof(g_pstrAppId));
- strcpy(g_pstrAppId, APPID);
+ strncpy(g_pstrAppId, APPID, strlen(APPID)+1);
g_bAccountCreation = true;
return;
}
#endif
if ( app_id != NULL )
{
- strcpy(g_szAppID, app_id);
+ strncpy(g_szAppID, app_id, strlen(app_id)+1);
}
if ( locale != NULL )
{
- strcpy(g_szLocale, locale);
+ strncpy(g_szLocale, locale, strlen(locale)+1);
}
if ( label != NULL )
{
- strcpy(g_szLabel, label);
+ strncpy(g_szLabel, label, strlen(label)+1);
}
if ( mainloop )
g_nPackageIdCB = 1;
if ( app_id != NULL )
{
- strcpy(g_szAppID, app_id);
+ strncpy(g_szAppID, app_id, strlen(app_id)+1);
}
if ( key != NULL )
{
- strcpy(g_szProviderFeatureArr[g_nProviderCount++], key);
+ strncpy(g_szProviderFeatureArr[g_nProviderCount++], key, strlen(key)+1);
}
if(user_data != NULL)
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, strlen(pPath)+1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, strlen(pAppDataPath)+1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
if ( pszGetVal != NULL )
{
FPRINTF("[Line : %d][%s] app_control_get_extra_data return extra data value after app_control_remove_extra_data call, value returned = %s\\n", __LINE__, API_NAMESPACE, pszGetVal);
+ FREE_MEMORY(pszGetVal);
app_control_destroy(hAppControl);
return 1;
}
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, strlen(pPath)+1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, strlen(pAppDataPath)+1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
memset(szSource, 0, sizeof(szSource));
memset(szDest, 0, sizeof(szDest));
- sprintf(szSource, "Tizen");
+ snprintf(szSource, sizeof(szSource)-1, "Tizen");
int nSourceLength = strlen((const char*)szSource);
i18n_uchar ucharSource[I18N_UCHAR_CAPACITY] = {0,};
int nUcharSourceLength = 0;
memset(szSource, 0, sizeof(szSource));
memset(szDest, 0, sizeof(szDest));
- sprintf(szSource, "Tizen");
+ snprintf(szSource, sizeof(szSource)-1, "Tizen");
i18n_uchar ucharSource[I18N_UCHAR_CAPACITY] = {0,};
i18n_uchar *pRet = i18n_ustring_copy_ua_n(ucharSource, szSource, strlen(szSource));
if ( i18n_ustring_get_length(ucharSource) <= 0 || pRet == NULL )
memset(szSource, 0, sizeof(szSource));
memset(szDest, 0, sizeof(szDest));
i18n_uchar ucharSource[I18N_UCHAR_CAPACITY] = {0,};
- sprintf(szSource, "Tizen");
+ snprintf(szSource, sizeof(szSource)-1, "Tizen");
i18n_uchar *pRet = i18n_ustring_copy_ua_n(ucharSource, szSource, strlen(szSource));
nUcharSourceLength = i18n_ustring_get_length(ucharSource);
if ( nUcharSourceLength <= 0 || pRet == NULL )
char szSource[I18N_UCHAR_CAPACITY] = {0};
memset(szSource, 0, sizeof(szSource));
- sprintf(szSource, "Tizen");
+ snprintf(szSource, sizeof(szSource)-1, "Tizen");
i18n_uchar ucharSource[I18N_UCHAR_CAPACITY] = {0,};
i18n_uchar ucharDest[I18N_UCHAR_CAPACITY] = {0,};
i18n_ustring_copy_ua_n(ucharSource, szSource, strlen(szSource));
char szSource[I18N_UCHAR_CAPACITY] = {0};
memset(szSource, 0, sizeof(szSource));
- sprintf(szSource, "Tizen");
+ snprintf(szSource, sizeof(szSource)-1, "Tizen");
i18n_uchar ucharSource[I18N_UCHAR_CAPACITY] = {0,};
i18n_uchar ucharDest[I18N_UCHAR_CAPACITY] = {0,};
i18n_ustring_copy_ua(ucharSource, szSource);
{
if ( strcmp(pszSetLocalName, pszTempGetLocalName) == 0 )
{
- sprintf(pszSetLocalName, "%s00", ADAPTER_NAME);
+ snprintf(pszSetLocalName, ADAPTER_NAME_LENGTH, "%s00", ADAPTER_NAME);
}
}
{
if ( strcmp(pszSetLocalName, pszTempGetLocalName) == 0 )
{
- sprintf(pszSetLocalName, "%s00", ADAPTER_NAME);
+ snprintf(pszSetLocalName, ADAPTER_NAME_LENGTH, "%s00", ADAPTER_NAME);
}
}
return 1;
}
- sprintf(szKey, "KEY%d", 1);
- sprintf(szValue, "VALUE%d", 1);
+ snprintf(szKey, sizeof(szKey)-1, "KEY%d", 1);
+ snprintf(szValue, sizeof(szValue)-1, "VALUE%d", 1);
int nRetVal = bundle_add_str(pBundle, szKey, szValue);
PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal), bundle_free(pBundle));
char szKeyByte[20] = {0};
char szValueByte[20] = {0};
- sprintf(szKeyByte, "KEY%dB", 1);
- sprintf(szValueByte, "VALUE%dB", 1);
+ snprintf(szKeyByte, sizeof(szKeyByte)-1, "KEY%dB", 1);
+ snprintf(szValueByte, sizeof(szValueByte)-1, "VALUE%dB", 1);
int nRetVal = bundle_add_byte(g_bundle, szKeyByte, szValueByte, 20);
PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_byte", BundleGetError(nRetVal));
char szKey[20] = {0};
char szValue[20] = {0};
- sprintf(szKey, "KEY%d", 1);
- sprintf(szValue, "VALUE%d", 1);
+ snprintf(szKey, sizeof(szKey)-1, "KEY%d", 1);
+ snprintf(szValue, sizeof(szValue)-1, "VALUE%d", 1);
int nRetVal = bundle_add_str(g_bundle, szKey, szValue);
PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal));
char szKeyByte[20] = {0};
char szValueByte[20] = {0};
- sprintf(szKeyByte, "KEY%dB", 1);
- sprintf(szValueByte, "VALUE%dB", 1);
+ snprintf(szKeyByte, sizeof(szKeyByte)-1, "KEY%dB", 1);
+ snprintf(szValueByte, sizeof(szValueByte)-1, "VALUE%dB", 1);
nRetVal = bundle_add_byte(g_bundle, szKeyByte, szValueByte, 20);
PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_byte", BundleGetError(nRetVal));
char szKey[20] = {0};
char szValue[20] = {0};
g_BundlestKeyVal = NULL;
- sprintf(szKey, "KEY%d", 1);
- sprintf(szValue, "VALUE%d", 1);
+ snprintf(szKey, sizeof(szKey)-1, "KEY%d", 1);
+ snprintf(szValue, sizeof(szValue)-1, "VALUE%d", 1);
int nRetVal = bundle_add_str(g_bundle, szKey, szValue);
PRINT_RESULT(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal));
bundle_del(g_bundle,(char *)KEY1));
nCounter++;
- sprintf(szKey, "KEY%d", 1);
- sprintf(szValue, "VALUE%d", 1);
+ snprintf(szKey, sizeof(szKey)-1, "KEY%d", 1);
+ snprintf(szValue, sizeof(szValue)-1, "VALUE%d", 1);
nRetVal = bundle_add_str(g_bundle,szKey, szValue);
PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRetVal, "bundle_add_str", BundleGetError(nRetVal) ,
*/
void GetViewURI(char szArr[MAX_ROW][MAX_COL])
{
- strcpy(szArr[0], _calendar_book._uri);
- strcpy(szArr[1], _calendar_event._uri);
- strcpy(szArr[2], _calendar_todo._uri);
- strcpy(szArr[3], _calendar_timezone._uri);
- strcpy(szArr[4], _calendar_attendee._uri);
- strcpy(szArr[5], _calendar_alarm._uri);
- strcpy(szArr[6], _calendar_extended_property._uri);
- strcpy(szArr[7], _calendar_updated_info._uri);
- strcpy(szArr[8], _calendar_event_calendar_book._uri);
- strcpy(szArr[9], _calendar_todo_calendar_book._uri);
- strcpy(szArr[10], _calendar_event_calendar_book_attendee._uri);
- strcpy(szArr[11], _calendar_instance_utime_calendar_book._uri);
- strcpy(szArr[12], _calendar_instance_localtime_calendar_book._uri);
- strcpy(szArr[13], _calendar_instance_utime_calendar_book_extended._uri);
- strcpy(szArr[14], _calendar_instance_localtime_calendar_book_extended._uri);
+ strncpy(szArr[0], _calendar_book._uri, MAX_COL-1);
+ strncpy(szArr[1], _calendar_event._uri, MAX_COL-1);
+ strncpy(szArr[2], _calendar_todo._uri, MAX_COL-1);
+ strncpy(szArr[3], _calendar_timezone._uri, MAX_COL-1);
+ strncpy(szArr[4], _calendar_attendee._uri, MAX_COL-1);
+ strncpy(szArr[5], _calendar_alarm._uri, MAX_COL-1);
+ strncpy(szArr[6], _calendar_extended_property._uri, MAX_COL-1);
+ strncpy(szArr[7], _calendar_updated_info._uri, MAX_COL-1);
+ strncpy(szArr[8], _calendar_event_calendar_book._uri, MAX_COL-1);
+ strncpy(szArr[9], _calendar_todo_calendar_book._uri, MAX_COL-1);
+ strncpy(szArr[10], _calendar_event_calendar_book_attendee._uri, MAX_COL-1);
+ strncpy(szArr[11], _calendar_instance_utime_calendar_book._uri, MAX_COL-1);
+ strncpy(szArr[12], _calendar_instance_localtime_calendar_book._uri, MAX_COL-1);
+ strncpy(szArr[13], _calendar_instance_utime_calendar_book_extended._uri, MAX_COL-1);
+ strncpy(szArr[14], _calendar_instance_localtime_calendar_book_extended._uri, MAX_COL-1);
}
/**
*/
void GetViewURIforDB(char szArr[MAX_ROW][MAX_COL])
{
- strcpy(szArr[0], _calendar_book._uri);
- strcpy(szArr[1], _calendar_event._uri);
- strcpy(szArr[2], _calendar_todo._uri);
- strcpy(szArr[3], _calendar_timezone._uri);
- strcpy(szArr[4], _calendar_attendee._uri);
- strcpy(szArr[5], _calendar_alarm._uri);
- strcpy(szArr[6], _calendar_extended_property._uri);
- strcpy(szArr[7], _calendar_instance_utime_calendar_book._uri);
- strcpy(szArr[8], _calendar_instance_localtime_calendar_book._uri);
- strcpy(szArr[9], _calendar_instance_utime_calendar_book_extended._uri);
- strcpy(szArr[10], _calendar_instance_localtime_calendar_book_extended._uri);
+ strncpy(szArr[0], _calendar_book._uri, MAX_COL-1);
+ strncpy(szArr[1], _calendar_event._uri, MAX_COL-1);
+ strncpy(szArr[2], _calendar_todo._uri, MAX_COL-1);
+ strncpy(szArr[3], _calendar_timezone._uri, MAX_COL-1);
+ strncpy(szArr[4], _calendar_attendee._uri, MAX_COL-1);
+ strncpy(szArr[5], _calendar_alarm._uri, MAX_COL-1);
+ strncpy(szArr[6], _calendar_extended_property._uri, MAX_COL-1);
+ strncpy(szArr[7], _calendar_instance_utime_calendar_book._uri, MAX_COL-1);
+ strncpy(szArr[8], _calendar_instance_localtime_calendar_book._uri, MAX_COL-1);
+ strncpy(szArr[9], _calendar_instance_utime_calendar_book_extended._uri, MAX_COL-1);
+ strncpy(szArr[10], _calendar_instance_localtime_calendar_book_extended._uri, MAX_COL-1);
}
*/
void GetViewURIforDBByVersion(char szArr[MAX_ROW][MAX_COL])
{
- strcpy(szArr[0], _calendar_event._uri);
- strcpy(szArr[1], _calendar_todo._uri);
+ strncpy(szArr[0], _calendar_event._uri, MAX_COL-1);
+ strncpy(szArr[1], _calendar_todo._uri, MAX_COL-1);
}
/**
static bool MapServiceProviderForeachCb(char* maps_provider, void* user_data)
{
memset( g_szMapsProvider, '\0', sizeof(char)*BUFFER);
- strcpy(g_szMapsProvider, "HERE");
+ strncpy(g_szMapsProvider, "HERE", sizeof(g_szMapsProvider)-1);
FPRINTF("[Line : %d][%s] Provider list from maps_service_foreach_provider is = %s\\n", __LINE__, API_NAMESPACE, g_szMapsProvider);
g_nCheckCb = true;
return false;
static bool MapServiceProviderForeachCb(char* maps_provider, void* user_data)
{
memset( g_szMapsProvider, '\0', sizeof(char)*BUFFER);
- strcpy(g_szMapsProvider, "HERE");
+ strncpy(g_szMapsProvider, "HERE", sizeof(g_szMapsProvider)-1);
FPRINTF("[Line : %d][%s] Provider list from maps_service_foreach_provider is = %s\\n", __LINE__, API_NAMESPACE, g_szMapsProvider);
g_nCheckCb = true;
return false;
memset( g_szMapsProvider, '\0', sizeof(char)*BUFFER);
if(maps_provider != NULL)
{
- strcpy(g_szMapsProvider, "HERE");
+ strncpy(g_szMapsProvider, "HERE", sizeof(g_szMapsProvider)-1);
FPRINTF("[Line : %d][%s] Provider list from maps_service_foreach_provider is = %s\\n", __LINE__, API_NAMESPACE, g_szMapsProvider);
}
else
static bool MapsServiceProviderForeachCb(char* maps_provider, void* user_data)
{
memset( g_szMapsProvider, '\0', sizeof(char)*BUFFER);
- strcpy(g_szMapsProvider, "HERE");
+ strncpy(g_szMapsProvider, "HERE", sizeof(g_szMapsProvider)-1);
FPRINTF("[Line : %d][%s] Provider list from maps_service_foreach_provider is = %s\\n", __LINE__, API_NAMESPACE, g_szMapsProvider);
g_nCheckCb = true;
return false;
}
else {
memset( g_szMapsProvider, '\0', sizeof(char)*BUFFER);
- strcpy(g_szMapsProvider, "HERE");
+ strncpy(g_szMapsProvider, "HERE", sizeof(g_szMapsProvider)-1);
FPRINTF("[Line : %d][%s] Provider list from maps_service_foreach_provider is = %s\\n", __LINE__, API_NAMESPACE, g_szMapsProvider);
}
}
memset(g_szMapsProvider, '\0', sizeof(char)*BUFFER);
- strcpy(g_szMapsProvider, "HERE");
+ strncpy(g_szMapsProvider, "HERE", sizeof(g_szMapsProvider)-1);
FPRINTF("[Line : %d][%s] Provider list from maps_service_foreach_provider is = %s\\n", __LINE__, API_NAMESPACE, g_szMapsProvider);
int nRet = maps_service_create(g_szMapsProvider, &g_HandleMapService);
if ( false == bMapsFeatureSupported)
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, strlen(pAppDataPath)+1);
FPRINTF("[Line: %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, strlen(pFinalPath)+1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line: %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
return true;
{
FPRINTF("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue);
g_file_path=(char*)malloc(strlen(pszValue)+ strlen( "sample.mp4" ) + 6);
- sprintf(g_file_path, "%s/res/%s", pszValue, "sample.mp4" );
+ snprintf(g_file_path, strlen(pszValue) + strlen("/res/sample.mp4") + 1, "%s/res/sample.mp4", pszValue);
}
else
{
FPRINTF("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue);
if(g_h264_path == NULL){
g_h264_path=(char*)malloc(strlen(pszValue)+ strlen( g_h264_file ) + 6);
- sprintf(g_h264_path, "%s/res/%s", pszValue, g_h264_file );
+ snprintf(g_h264_path, strlen("/res/") + strlen(pszValue) + strlen(g_h264_file) + 1, "%s/res/%s", pszValue, g_h264_file );
}
if(g_file_path == NULL){
g_file_path=(char*)malloc(strlen(pszValue)+ strlen( g_file ) + 6);
- sprintf(g_file_path, "%s/res/%s", pszValue, g_file );
+ snprintf(g_file_path, strlen("/res/") + strlen(pszValue) + strlen(g_file) + 1, "%s/res/%s", pszValue, g_file );
}
}
else
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
#if DEBUG
FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Contacts_Service2_p\\n", __LINE__, API_NAMESPACE);
#endif
- if( g_bIsConnected || (!g_bIsConnected && ContactsServiceConnect()) )
+ if( g_bIsConnected || ContactsServiceConnect() )
{
contacts_record_destroy(g_hRecordFirst, true);
contacts_record_destroy(g_hFirstProfileRecord, true);
system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &compareString);
std::string result = mApplication.GetRegion();
DALI_CHECK_FAIL( result.compare( std::string(compareString) ), "Application::GetRegion is failed." );
-
+ FREE_MEMORY(compareString);
DaliLog::PrintPass();
}
system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &compareString);
std::string result = mApplication.GetLanguage();
DALI_CHECK_FAIL( result.compare( std::string(compareString) ), "Application::GetLanguage is failed." );
-
+ FREE_MEMORY(compareString);
DaliLog::PrintPass();
}
// Functor to test whether an animation finish signal is emitted
struct AnimationFinishCheck
{
- AnimationFinishCheck(bool& signalReceived) : mSignalReceived(signalReceived)
+ explicit AnimationFinishCheck(bool& signalReceived) : mSignalReceived(signalReceived)
{
}
{
}
- TestCallbackBase( void(*function)() )
+ explicit TestCallbackBase( void(*function)() )
: CallbackBase( reinterpret_cast< CallbackBase::Function >( function ) )
{ }
template< typename R >
- TestCallbackBase( R(*function)() )
+ explicit TestCallbackBase( R(*function)() )
: CallbackBase( reinterpret_cast< CallbackBase::Function >( function ) )
{ }
template< typename P1 >
- TestCallbackBase( void(*function)(P1) )
+ explicit TestCallbackBase( void(*function)(P1) )
: CallbackBase( reinterpret_cast< CallbackBase::Function >( function ) )
{ }
template< typename P1, typename R >
- TestCallbackBase( R(*function)(P1) )
+ explicit TestCallbackBase( R(*function)(P1) )
: CallbackBase( reinterpret_cast< CallbackBase::Function >( function ) )
{ }
template< typename P1, typename P2 >
- TestCallbackBase( void(*function)(P1,P2) )
+ explicit TestCallbackBase( void(*function)(P1,P2) )
: CallbackBase( reinterpret_cast< CallbackBase::Function >( function ) )
{ }
template< typename P1, typename P2, typename R >
- TestCallbackBase( R(*function)(P1,P2) )
+ explicit TestCallbackBase( R(*function)(P1,P2) )
: CallbackBase( reinterpret_cast< CallbackBase::Function >( function ) )
{ }
template< typename P1, typename P2, typename P3 >
- TestCallbackBase( void(*function)(P1,P2,P3) )
+ explicit TestCallbackBase( void(*function)(P1,P2,P3) )
: CallbackBase( reinterpret_cast< CallbackBase::Function >( function ) )
{ }
template< typename P1, typename P2, typename P3, typename R >
- TestCallbackBase( R(*function)(P1,P2,P3) )
+ explicit TestCallbackBase( R(*function)(P1,P2,P3) )
: CallbackBase( reinterpret_cast< CallbackBase::Function >( function ) )
{ }
};
// Template structure for different type value
struct STConstraintSourceTypeValue
{
- STConstraintSourceTypeValue(bool bValue) : bValue(bValue)
+ explicit STConstraintSourceTypeValue(bool bValue) : bValue(bValue)
{
}
{
}
- STConstraintTypeValue(type tValue) : tValue(tValue)
+ explicit STConstraintTypeValue(type tValue) : tValue(tValue)
{
}
static const Quaternion QUATERNION_VALUE;
// Construction & Destruction
- PropertyInputImpl( Property::Type type ) : mType( type ) { }
+ explicit PropertyInputImpl( Property::Type type ) : mType( type ) { }
virtual ~PropertyInputImpl() { }
// Methods
public:
// Construction & Destruction
- Vector3PropertyInput( Vector3& value )
+ explicit Vector3PropertyInput( Vector3& value )
: PropertyInputImpl( Property::VECTOR3 ),
mValue( value )
{
public:
// Construction & Destruction
- QuaternionPropertyInput( Quaternion& value )
+ explicit QuaternionPropertyInput( Quaternion& value )
: PropertyInputImpl( Property::ROTATION ),
mValue( value )
{
struct KeyEventReceivedFunctor
{
- KeyEventReceivedFunctor( KeyEventSignalData& data ) : m_signalData( data )
+ explicit KeyEventReceivedFunctor( KeyEventSignalData& data ) : m_signalData( data )
{
}
struct TouchedFunctor
{
- TouchedFunctor( TouchedSignalData& data ) : m_singleData( data )
+ explicit TouchedFunctor( TouchedSignalData& data ) : m_singleData( data )
{
}
private:
- TestCustomActor( Impl::TestCustomActor& impl ) : CustomActor( impl )
+ explicit TestCustomActor( Impl::TestCustomActor& impl ) : CustomActor( impl )
{
}
class TestMap
{
public:
- TestMap(Property::Map map)
+ explicit TestMap(Property::Map map)
: mMap(map)
{
}
{
public:
- PropertyNotificationConstWrapper(PropertyNotification propertyNotification):mPropertyNotification(propertyNotification)
+ explicit PropertyNotificationConstWrapper(PropertyNotification propertyNotification):mPropertyNotification(propertyNotification)
{
}
private:
- CustomActorRegistered(Internal::CustomActor* pInternal)
+ explicit CustomActorRegistered(Internal::CustomActor* pInternal)
: CustomActor(pInternal)
{
}
- CustomActorRegistered( ImplPr::CustomActorRegistered& impl )
+ explicit CustomActorRegistered( ImplPr::CustomActorRegistered& impl )
: CustomActor( impl )
{
}
template <typename T>
struct CheckCopyCtorP
{
- CheckCopyCtorP(Property::Value value)
+ explicit CheckCopyCtorP(Property::Value value)
{
Property::Value copy( value );
DALI_CHECK_FAIL( !(value.Get<T>() == copy.Get<T>() ) , "Property::Value copy constructor has fialed.");
private:
- RegisteredCustomActor(Internal::CustomActor* pInternal)
+ explicit RegisteredCustomActor(Internal::CustomActor* pInternal)
: CustomActor(pInternal)
{
}
- RegisteredCustomActor( ImplSct::RegisteredCustomActor& impl )
+ explicit RegisteredCustomActor( ImplSct::RegisteredCustomActor& impl )
: CustomActor( impl )
{
}
/** Functor for void (float) type **/
struct VoidFunctorFloat
{
- VoidFunctorFloat( float* fLastReceivedValue )
+ explicit VoidFunctorFloat( float* fLastReceivedValue )
: mLastReceivedValue( fLastReceivedValue )
{
++m_nTotalInstanceCount;
private:
- MyTestCustomActor(Dali::Internal::CustomActor* internal)
+ explicit MyTestCustomActor(Dali::Internal::CustomActor* internal)
: CustomActor(internal)
{
}
- MyTestCustomActor( ImplMine::MyTestCustomActor& impl )
+ explicit MyTestCustomActor( ImplMine::MyTestCustomActor& impl )
: CustomActor( impl )
{
}
private:
- MyTestCustomActor2(Dali::Internal::CustomActor* internal)
+ explicit MyTestCustomActor2(Dali::Internal::CustomActor* internal)
: CustomActor(internal)
{
}
- MyTestCustomActor2( ImplMine::MyTestCustomActor& impl )
+ explicit MyTestCustomActor2( ImplMine::MyTestCustomActor& impl )
: CustomActor( impl )
{
}
// Functor that sets the data when called
struct GestureReceivedFunctor
{
- GestureReceivedFunctor(SignalData& data) : signalData(data) { }
+ explicit GestureReceivedFunctor(SignalData& data) : signalData(data) { }
void operator()(Actor actor, LongPressGesture longPress)
{
private:
- TestCustomActorForTypeRegistry(Internal::CustomActor* internal)
+ explicit TestCustomActorForTypeRegistry(Internal::CustomActor* internal)
: CustomActor(internal)
{
}
- TestCustomActorForTypeRegistry( Impl::TestCustomActorForTypeRegistry& impl )
+ explicit TestCustomActorForTypeRegistry( Impl::TestCustomActorForTypeRegistry& impl )
: CustomActor( impl )
{
}
private:
- TestCustomActorForTypeRegistry_2(Internal::CustomActor* internal)
+ explicit TestCustomActorForTypeRegistry_2(Internal::CustomActor* internal)
: CustomActor(internal)
{
}
- TestCustomActorForTypeRegistry_2( Impl::TestCustomActorForTypeRegistry& impl )
+ explicit TestCustomActorForTypeRegistry_2( Impl::TestCustomActorForTypeRegistry& impl )
: CustomActor( impl )
{
}
class FocusChangedCallback : public Dali::ConnectionTracker
{
public:
- FocusChangedCallback(bool& signalReceived)
+ explicit FocusChangedCallback(bool& signalReceived)
: m_bSignalVerified(signalReceived),
m_OriginalFocusedActor(),
m_CurrentFocusedActor()
class FocusOvershotCallback : public Dali::ConnectionTracker
{
public:
- FocusOvershotCallback(bool& signalReceived)
+ explicit FocusOvershotCallback(bool& signalReceived)
: m_bSignalVerified(signalReceived),
m_CurrentFocusedActor(),
m_FocusOvershotDirection(Toolkit::AccessibilityManager::OVERSHOT_NEXT)
class KeyboardPreFocusChangeCallback : public Dali::ConnectionTracker
{
public:
- KeyboardPreFocusChangeCallback(bool& bsignalReceived)
+ explicit KeyboardPreFocusChangeCallback(bool& bsignalReceived)
: m_bSignalVerified(bsignalReceived),
m_CurrentFocusedActor(),
m_ProposedActorToFocus(),
class KeyboardFocusChangedCallback : public Dali::ConnectionTracker
{
public:
- KeyboardFocusChangedCallback(bool& bsignalReceived)
+ explicit KeyboardFocusChangedCallback(bool& bsignalReceived)
: m_bSignalVerified(bsignalReceived),
m_OriginalFocusedActor(),
m_CurrentFocusedActor()
/**
* @param[in] offset The offset to be added to current.
*/
- ScrollviewSumConstraint(const Vector3& offset):m_Offset(offset)
+ explicit ScrollviewSumConstraint(const Vector3& offset):m_Offset(offset)
{
}
snprintf(word_desc_len, 16, "%d", strlen("'word_0 initially'") - 2);
memset(g_szWhere, 0, QUERYSIZE);
- sprintf(g_szWhere, "rowid<3");
+ snprintf(g_szWhere, QUERYSIZE-1, "rowid<3");
g_pstData = bundle_create();
if ( g_pstData == NULL )
START_TEST;
memset(g_szWhere, 0, QUERYSIZE);
- sprintf(g_szWhere, "rowid=1");
+ snprintf(g_szWhere, QUERYSIZE-1, "rowid=1");
// Target API
char *pszQuery = data_control_provider_create_delete_statement(g_stSqlProvider, g_szWhere);
START_TEST;
memset(g_szWhere, 0, QUERYSIZE);
- sprintf(g_szWhere, "rowid=1");
+ snprintf(g_szWhere, QUERYSIZE-1, "rowid=1");
bundle *pstData = bundle_create();
if ( pstData == NULL )
START_TEST;
memset(g_szWhere, 0, QUERYSIZE);
- sprintf(g_szWhere, "rowid=1");
+ snprintf(g_szWhere, QUERYSIZE-1, "rowid=1");
const char *pszColoumn = DUMMYKEY;
const char *pszOrder = "WORD ASC";
bundle_add_str(pstData, DUMMYKEY, DUMMYVALUE);
memset(g_szWhere, 0, QUERYSIZE);
- sprintf(g_szWhere, "rowid=1");
+ snprintf(g_szWhere, QUERYSIZE-1, "rowid=1");
data_control_sql_response_cb stSqlCallBack = {0};
stSqlCallBack.insert_cb = DataControlSqlInsertResponseCb;
bundle_add_str(pstData, DUMMYKEY, DUMMYVALUE);
memset(g_szWhere, 0, QUERYSIZE);
- sprintf(g_szWhere, "rowid=1");
+ snprintf(g_szWhere, QUERYSIZE-1, "rowid=1");
g_bCallbackHit = false;
g_bIsInsertDataCheck = true;
bundle_add_str(pstData, DUMMYKEY, DUMMYVALUE);
memset(g_szWhere, 0, QUERYSIZE);
memset(g_szWordDesc, 0, sizeof(g_szWordDesc));
- sprintf(g_szWhere, "rowid=1");
+ snprintf(g_szWhere, QUERYSIZE-1, "rowid=1");
bundle *pstNewData = bundle_create();
if ( pstNewData == NULL )
bundle_add_str(pstData, DUMMYKEY, DUMMYVALUE);
memset(g_szWhere, 0, QUERYSIZE);
- sprintf(g_szWhere, "rowid=1");
+ snprintf(g_szWhere, QUERYSIZE-1, "rowid=1");
const char *pszOrder = "WORD ASC";
char *pszKey = DUMMYKEY;
pszImgPath = (char*) calloc(1, strlen(pszAppData) + strlen(pszFileName) + 1);
if(pszImgPath == NULL)
return pszImgPath;
- sprintf(pszImgPath, "%s%s",pszAppData, pszFileName );
+ snprintf(pszImgPath, strlen(pszAppData) + strlen(pszFileName) + 1, "%s%s",pszAppData, pszFileName );
FPRINTF("[Line : %d][%s] app_get_data_path() is %s\\n", __LINE__, API_NAMESPACE, pszImgPath);
return pszImgPath;
}
{
FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error in start-up\\n", __LINE__, API_NAMESPACE);
- strcpy(g_pstrRecipient, EMAILADDRESS);
+ strncpy(g_pstrRecipient, EMAILADDRESS, CONFIG_VALUE_LEN_MAX-1);
FPRINTF("[Line : %d][%s] Using recipient address : %s\\n", __LINE__, API_NAMESPACE, EMAILADDRESS);
}
}
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
nRet = media_info_get_media_id(g_hAudioInfo, &pszMediaId);
PRINT_RESULTNONE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), media_content_disconnect());
memset(g_szAudioId, 0, PATHLEN);
- strcpy(g_szAudioId, pszMediaId);
+ strncpy(g_szAudioId, pszMediaId, PATHLEN-1);
FREE_MEMORY(pszMediaId);
nRet = media_info_get_audio(g_hAudioInfo, &g_hAudioMeta);
PRINT_RESULTFALSE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), QuitGmainLoop());
memset(g_szMediaId, 0, PATHLEN);
- strcpy(g_szMediaId, szMediaId);
+ strncpy(g_szMediaId, szMediaId, PATHLEN-1);
FREE_MEMORY(szMediaId);
g_CallBackHit = true;
QuitGmainLoop();
void AppendPaths(char *FirstPath, char *SecondPath, char *FinalPath)
{
memset(FinalPath, 0, PATHLEN);
- strcpy(FinalPath, FirstPath);
- strcat(FinalPath, "/");
- strcat(FinalPath, SecondPath);
+ strncpy(FinalPath, FirstPath, PATHLEN-1);
+ strncat(FinalPath, "/", PATHLEN-1-strlen(FinalPath));
+ strncat(FinalPath, SecondPath, PATHLEN-1-strlen(FinalPath));
FPRINTF("[Line : %d][%s] Appended Path is : %s\\n", __LINE__, API_NAMESPACE, FinalPath);
}
CHECK_HANDLE(pszTempPath, "storage_get_directory");
memset(FinalPath, 0, PATHLEN);
- strcpy(FinalPath, pszTempPath);
+ strncpy(FinalPath, pszTempPath, PATHLEN-1);
FREE_MEMORY(pszTempPath);
FPRINTF("[Line : %d][%s] Folder Path is : %s\\n", __LINE__, API_NAMESPACE, FinalPath);
void AppendSlash(char *FirstPath, char *FinalPath)
{
memset(FinalPath, 0, PATHLEN);
- strcpy(FinalPath, FirstPath);
- strcat(FinalPath, "/");
+ strncpy(FinalPath, FirstPath, PATHLEN-1);
+ strncat(FinalPath, "/", PATHLEN-1-strlen(FinalPath));
FPRINTF("[Line : %d][%s] Appended Path is : %s\\n", __LINE__, API_NAMESPACE, FinalPath);
}
nRet = media_info_get_media_id(g_hImageInfo, &pszMediaId);
PRINT_RESULTNONE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), media_content_disconnect());
memset(g_szImageId, 0, PATHLEN);
- strcpy(g_szImageId, pszMediaId);
+ strncpy(g_szImageId, pszMediaId, PATHLEN-1);
FREE_MEMORY(pszMediaId);
nRet = media_face_create(g_szImageId,&g_hFace);
nRet = media_info_get_media_id(g_hImageInfo, &pszMediaId);
PRINT_RESULTNONE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), media_content_disconnect());
memset(g_szImageId, 0, PATHLEN);
- strcpy(g_szImageId, pszMediaId);
+ strncpy(g_szImageId, pszMediaId, PATHLEN - 1);
FREE_MEMORY(pszMediaId);
nRet = media_info_get_image(g_hImageInfo, &g_hImageMeta);
nRet = media_info_get_media_id(g_hAudioInfo, &pszMediaId);
PRINT_RESULTNONE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), media_content_disconnect());
memset(g_szAudioId, 0, PATHLEN);
- strcpy(g_szAudioId, pszMediaId);
+ strncpy(g_szAudioId, pszMediaId, PATHLEN - 1);
FREE_MEMORY(pszMediaId);
nRet = GetFolderPath(STORAGE_DIRECTORY_IMAGES, g_szImageFolder);
nRet = media_info_get_media_id(g_hImageInfo, &pszMediaId);
PRINT_RESULTNONE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), media_content_disconnect());
memset(g_szImageId, 0, PATHLEN);
- strcpy(g_szImageId, pszMediaId);
+ strncpy(g_szImageId, pszMediaId, PATHLEN - 1);
FREE_MEMORY(pszMediaId);
nRet = GetFolderPath(STORAGE_DIRECTORY_VIDEOS, g_szVideoFolder);
nRet = media_info_get_media_id(g_hVideoInfo, &pszMediaId);
PRINT_RESULTNONE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), media_content_disconnect());
memset(g_szVideoId, 0, PATHLEN);
- strcpy(g_szVideoId, pszMediaId);
+ strncpy(g_szVideoId, pszMediaId, PATHLEN - 1);
FREE_MEMORY(pszMediaId);
g_bMediaContentStartup = true;
nRet = media_info_get_media_id(g_hAudioInfo, &pszMediaId);
PRINT_RESULT(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet));
memset(g_szAudioId, 0, PATHLEN);
- strncpy(g_szAudioId, pszMediaId, sizeof(g_szAudioId));
+ strncpy(g_szAudioId, pszMediaId, PATHLEN - 1);
FREE_MEMORY(pszMediaId);
return 0;
PRINT_RESULTFALSE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), QuitGmainLoop());
memset(g_szMediaId, 0, PATHLEN);
- strcpy(g_szMediaId, szMediaId);
+ strncpy(g_szMediaId, szMediaId, PATHLEN - 1);
FREE_MEMORY(szMediaId);
g_CallBackHit = true;
QuitGmainLoop();
PRINT_RESULTFALSE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), QuitGmainLoop());
memset(g_szMediaId, 0, PATHLEN);
- strcpy(g_szMediaId, szMediaId);
+ strncpy(g_szMediaId, szMediaId, PATHLEN - 1);
FREE_MEMORY(szMediaId);
g_CallBackHit = true;
QuitGmainLoop();
nRet = media_info_get_media_id(g_hVideoInfo, &pszMediaId);
PRINT_RESULTNONE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_get_media_id", MediaContentGetError(nRet), media_content_disconnect());
memset(g_szVideoId, 0, PATHLEN);
- strcpy(g_szVideoId, pszMediaId);
+ strncpy(g_szVideoId, pszMediaId, PATHLEN - 1);
FREE_MEMORY(pszMediaId);
nRet = media_info_get_video(g_hVideoInfo, &g_hVideoMeta);
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATHLEN-1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATHLEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATHLEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
frames = (char **) realloc(frames, ++frames_counter * 1024);
- sprintf(frames[frames_counter - 1], "%s/%s", track_seq_path, ent->d_name);
+ snprintf(frames[frames_counter - 1], strlen(track_seq_path)+strlen("/")+strlen(ent->d_name)+1, "%s/%s", track_seq_path, ent->d_name);
}
closedir(dir);
}
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, strlen(pAppDataPath)+1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, strlen(pFinalPath)+1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
return false;
}
-/** @} */ //end of itc-messages
\ No newline at end of file
+/** @} */ //end of itc-messages
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line: %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
return true;
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line: %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line: %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line: %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
return true;
//case GESTURE_EVENT_DETECTED: szGestureEvent = "GESTURE_EVENT_DETECTED"; break; /**< The gesture is detected */
//case GESTURE_SHAKE_DETECTED: szGestureEvent = "GESTURE_SHAKE_DETECTED"; break; /**< Shake gesture is detected */
//case GESTURE_SNAP_X_NEGATIVE: szGestureEvent = "GESTURE_SNAP_X_NEGATIVE"; break; /**< -X snap is detected */
- case GESTURE_EVENT_DETECTED: szGestureEvent = "GESTURE_EVENT_DETECTED or GESTURE_SHAKE_DETECTED or GESTURE_SNAP_X_NEGATIVE";
+ case GESTURE_EVENT_DETECTED: szGestureEvent = "GESTURE_EVENT_DETECTED or GESTURE_SHAKE_DETECTED or GESTURE_SNAP_X_NEGATIVE"; break;
//case GESTURE_SHAKE_FINISHED: szGestureEvent = "GESTURE_SHAKE_FINISHED"; break; /**< Shake gesture finished */
//case GESTURE_SNAP_X_POSITIVE: szGestureEvent = "GESTURE_SNAP_X_POSITIVE"; break; /**< +X snap is detected */
return 1;
}
- sprintf((char *)szSetId, "ID_%d", 1);
+ snprintf((char *)szSetId, sizeof(szSetId)-1, "ID_%d", 1);
nLength = strlen((char *)szSetId);
int nRet = nfc_ndef_record_set_id(g_hRecord, szSetId, nLength);
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
return true;
}
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
return szErrorVal;
}
-/** @} */ //end of itc-notification
\ No newline at end of file
+/** @} */ //end of itc-notification
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line: %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
return true;
}
g_RecorderFile = (char *)malloc(strlen(pszPath) + strlen(FILENAME) + 1);
memset(g_RecorderFile, 0x00, (strlen(pszPath) + strlen(FILENAME) + 1));
- strcpy(g_RecorderFile, pszPath);
- strcat(g_RecorderFile, FILENAME);
+ strncpy(g_RecorderFile, pszPath, strlen(pszPath)+1);
+ strncat(g_RecorderFile, FILENAME, strlen(FILENAME)+1);
FPRINTF("[Line: %d][%s] Output File Path is %s\\n", __LINE__,API_NAMESPACE, g_RecorderFile);
}
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, strlen(pPath)+1);
return true;
}
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, strlen(pAppDataPath)+1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
return true;
}
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
#define TIMEOUT_CB 5000
#define API_NAMESPACE "STT_ITC"
#define PATH_LEN 1024
+#define LANGUAGE_LEN 256
+#define ENGINE_LEN 256
#define START_SOUND "start_sound.wav"
#define STOP_SOUND "stop_sound.wav"
#define TIME_LIMIT 20
if ( g_szPreviousLanguage == NULL )
{
- g_szPreviousLanguage = (char *) malloc(256 * sizeof(char));
+ g_szPreviousLanguage = (char *) malloc(LANGUAGE_LEN * sizeof(char));
}
else
{
- memset(g_szPreviousLanguage, 0, 256);
+ memset(g_szPreviousLanguage, 0, LANGUAGE_LEN);
}
- strcpy(g_szPreviousLanguage, previous_language);
+ strncpy(g_szPreviousLanguage, previous_language, LANGUAGE_LEN-1);
if ( g_szCurrentLanguage == NULL )
{
- g_szCurrentLanguage = (char *) malloc(256 * sizeof(char));
+ g_szCurrentLanguage = (char *) malloc(LANGUAGE_LEN * sizeof(char));
}
else
{
- memset(g_szCurrentLanguage, 0, 256);
+ memset(g_szCurrentLanguage, 0, LANGUAGE_LEN);
}
- strcpy(g_szCurrentLanguage, current_language);
+ strncpy(g_szCurrentLanguage, current_language, LANGUAGE_LEN-1);
}
/**
if ( g_szSupportedEngineIDs[g_nSupportedEngineCount] == NULL )
{
- g_szSupportedEngineIDs[g_nSupportedEngineCount] = (char *) malloc(256 * sizeof(char));
+ g_szSupportedEngineIDs[g_nSupportedEngineCount] = (char *) malloc(ENGINE_LEN * sizeof(char));
}
else
{
- memset(g_szSupportedEngineIDs[g_nSupportedEngineCount], 0, 256);
+ memset(g_szSupportedEngineIDs[g_nSupportedEngineCount], 0, ENGINE_LEN);
}
- strcpy(g_szSupportedEngineIDs[g_nSupportedEngineCount], engine_id);
+ strncpy(g_szSupportedEngineIDs[g_nSupportedEngineCount], engine_id, ENGINE_LEN-1);
if ( g_szSupportedEngineNames[g_nSupportedEngineCount] == NULL )
{
- g_szSupportedEngineNames[g_nSupportedEngineCount] = (char *) malloc(256 * sizeof(char));
+ g_szSupportedEngineNames[g_nSupportedEngineCount] = (char *) malloc(ENGINE_LEN * sizeof(char));
}
else
{
- memset(g_szSupportedEngineNames[g_nSupportedEngineCount], 0, 256);
+ memset(g_szSupportedEngineNames[g_nSupportedEngineCount], 0, ENGINE_LEN);
}
- strcpy(g_szSupportedEngineNames[g_nSupportedEngineCount], engine_name);
+ strncpy(g_szSupportedEngineNames[g_nSupportedEngineCount], engine_name, ENGINE_LEN-1);
g_nSupportedEngineCount++;
if ( g_szSupportedLanguages[g_nSupportedLanguageCount] == NULL )
{
- g_szSupportedLanguages[g_nSupportedLanguageCount] = (char *) malloc(256 * sizeof(char));
+ g_szSupportedLanguages[g_nSupportedLanguageCount] = (char *) malloc(LANGUAGE_LEN * sizeof(char));
}
else
{
- memset(g_szSupportedLanguages[g_nSupportedLanguageCount], 0, 256);
+ memset(g_szSupportedLanguages[g_nSupportedLanguageCount], 0, LANGUAGE_LEN);
}
- strcpy(g_szSupportedLanguages[g_nSupportedLanguageCount], language);
+ strncpy(g_szSupportedLanguages[g_nSupportedLanguageCount], language, LANGUAGE_LEN-1);
g_nSupportedLanguageCount++;
return true;
pszImgPath = (char*) calloc(1, strlen(pszAppData) + strlen(pszFileName)+1);
if (pszImgPath == NULL)
return pszImgPath;
- sprintf(pszImgPath, "%s%s",pszAppData, pszFileName );
+ snprintf(pszImgPath, strlen(pszAppData) + strlen(pszFileName) + 1, "%s%s",pszAppData, pszFileName );
FPRINTF("[Line : %d][%s] app_get_data_path() is %s\\n", __LINE__, API_NAMESPACE, pszImgPath);
return pszImgPath;
}
dlog_print(DLOG_INFO, "NativeTCT", "%s must be exited", func_name);
ui_app_exit();
}
+ FREE_MEMORY_TC(func_name);
return;
}
}
dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, func_name);
printf("Unknown testcase name: \"%s\"\n", func_name);
+ FREE_MEMORY_TC(func_name);
return;
}
return;
}
}
- sprintf(pszCompId, "%d", nCompId);
+ snprintf(pszCompId, sizeof(pszCompId)-1, "%d", nCompId);
nRet = app_control_add_extra_data(hAppControl, "COMP_ID", pszCompId);
if(nRet != APP_CONTROL_ERROR_NONE)
{
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
return true;
}
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
return true;
}
return false;
}
- strcpy(pAppDataPath, pPath);
+ strncpy(pAppDataPath, pPath, PATH_LEN-1);
FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath);
return true;
}
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, pAppDataPath);
- strcat(pFinalPath, pInputPath);
+ strncpy(pFinalPath, pAppDataPath, PATH_LEN-1);
+ strncat(pFinalPath, pInputPath, strlen(pInputPath)+1);
return true;
}
}
memset(pFinalPath, 0, PATH_LEN);
- strcpy(pFinalPath, "file://"); //file prefix appended
- strcat(pFinalPath, pFileAppDataPath);
+ strncpy(pFinalPath, "file://", PATH_LEN-1); //file prefix appended
+ strncat(pFinalPath, pFileAppDataPath, strlen(pFileAppDataPath)+1);
FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath);
}
char id[10];
- sprintf(id,"%d",TEST_AUTOFILL_PROFILE_ID);
+ snprintf(id, sizeof(id)-1, "%d",TEST_AUTOFILL_PROFILE_ID);
ewk_autofill_profile_data_set(profile, EWK_PROFILE_ID, id);
ewk_autofill_profile_data_set(profile, EWK_PROFILE_NAME, TEST_AUTOFILL_PROFILE_NAME);
ewk_autofill_profile_data_set(profile, EWK_PROFILE_COMPANY, TEST_AUTOFILL_PROFILE_COMPANY);
g_BodyDone = (char*)malloc((size + 1) * sizeof(char));
CHECK_HANDLE_CLEANUP(g_BodyDone,"malloc:failure:ITc_ewk_intercept_request_response_header_add_p",free(g_BodyAjaxTestDone));
- snprintf(g_BodyDone, size+1, g_BodyFormat, g_BaseTitle, g_BodyAjaxTestDone, g_InterceptUrlAjax);
+ snprintf(g_BodyDone, size+1, g_BodyFormat, g_BaseTitle);
size = snprintf(NULL, 0, g_Expected_title_format, g_Test_header_field_1, g_Test_header_value_1, g_Test_header_field_2, g_Test_header_value_2);
g_Expected_title_done = (char*)malloc((size + 1) * sizeof(char));
CHECK_HANDLE(g_BodyAjaxTestDone, "Malloc failure:ITc_ewk_intercept_request_response_header_map_add_p")
snprintf(g_BodyAjaxTestDone, size+1, g_BodyAjaxTestFormat, g_Test_header_field_1, g_Test_header_field_1, g_Test_header_field_2, g_Test_header_field_2);
- size = snprintf(NULL, 0, g_BodyFormat, g_BaseTitle, g_BodyAjaxTestDone, g_InterceptUrlAjax);
+ size = snprintf(NULL, 0, g_BodyFormat, g_BaseTitle, g_BodyAjaxTestDone, g_InterceptUrlAjax);
g_BodyDone = (char*)malloc((size + 1) * sizeof(char));
CHECK_HANDLE_CLEANUP(g_BodyDone, "Malloc failure :ITc_ewk_intercept_request_response_header_map_add_p",free(g_BodyAjaxTestDone))
- snprintf(g_BodyDone, size+1, g_BodyFormat, g_BaseTitle, g_BodyAjaxTestDone, g_InterceptUrlAjax);
+ snprintf(g_BodyDone, size+1, g_BodyFormat, g_BaseTitle);
size = snprintf(NULL, 0, g_Expected_title_format, g_Test_header_field_1, g_Test_header_value_1, g_Test_header_field_2, g_Test_header_value_2);
g_Expected_title_done = (char*)malloc((size + 1) * sizeof(char));
int size = snprintf(NULL, 0, g_BodyFormat, g_BaseTitle, g_BodyAjaxTestDoneStatusSet, g_InterceptUrlAjax);
g_BodyDone = (char*)malloc((size + 1) * sizeof(char));
CHECK_HANDLE(g_BodyDone, "Malloc failure:ITc_ewk_intercept_request_response_status_set_p");
- snprintf(g_BodyDone, size+1, g_BodyFormat, g_BaseTitle, g_BodyAjaxTestDoneStatusSet, g_InterceptUrlAjax);
+ snprintf(g_BodyDone, size+1, g_BodyFormat, g_BaseTitle);
evas_object_smart_callback_add(objWebkit_EFL_view.webview, "load,finished", webkit_EFL_LoadFinished, NULL);
evas_object_smart_callback_add(objWebkit_EFL_view.webview, "load,error", webkit_EFL_LoadError, NULL);
g_bWidgetServiceCBFlag = true;
FPRINTF("[Line: %d][%s] In WidgetListCB\\n", __LINE__, API_NAMESPACE);
- strcpy(g_szPkgid,pkgid);
- strcpy(g_szWidgetid,widgetid);
+ strncpy(g_szPkgid, pkgid, strlen(pkgid)+1);
+ strncpy(g_szWidgetid, widgetid, strlen(widgetid)+1);
FPRINTF("[Line: %d][%s] PkgId is %s and WidgetId is %s\\n", __LINE__, API_NAMESPACE, g_szPkgid, g_szWidgetid);
if ( g_loop != NULL )
return -1;
}
- strcpy(g_szInstanceId,instance_id);
+ strncpy(g_szInstanceId, instance_id, strlen(instance_id)+1);
FPRINTF("[Line: %d][%s] InstanceId is %s\\n", __LINE__, API_NAMESPACE, g_szInstanceId);
if ( g_loop != NULL )
g_connection_state = connection_state;
if ( mac_address != NULL )
{
- strcpy(g_szMacAdd, mac_address);
+ strncpy(g_szMacAdd, mac_address, strlen(mac_address)+1);
}
if ( g_pMainLoop != NULL )
{
if ( ssid != NULL )
{
- strcpy(g_szSSID, ssid);
+ strncpy(g_szSSID, ssid, strlen(ssid)+1);
*((bool *)user_data) = true; // the one which will be removed is found
}
return false;