[Tizen] fix TCT BLOCK issue 90/141690/1
authorminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:16:36 +0000 (10:16 +0900)
committerminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:16:39 +0000 (10:16 +0900)
This reverts commit 2e6b5aaeb6c212913eb9b126ced65c506f1c6997.

Change-Id: Ia2191ff8410d03753d2e609ce0fc14fe1186223a

dali-csharp-binder/src/application.cpp
dali-csharp-binder/src/dali_wrap.cpp

index 464b80d..cac5a2d 100755 (executable)
@@ -115,11 +115,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Application_New__SWIG_1(int jarg1) {
     // allocate the string data
     for( int i=0; i < numStrings; i++)
     {
-      array[i]=(char *)malloc( stringLength * sizeof(char *) );
+      array[i]=(char *)malloc( stringLength * sizeof(char) );
     }
     array[ numStrings ] =  NULL; // we allocated +1 for hold the NULL part
 
-    strcpy( array[0], "dali-csharp-app");
+    std::string temp = "dali-csharp-app";
+    array[0][temp.copy(array[0], strlen(array[0])-1)] = '\0';
 
     arg1 = &argC;
     arg2 = &argV;
@@ -164,11 +165,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Application_New__SWIG_2(int jarg1, cha
     // allocate the string data
     for( int i=0; i < numStrings; i++)
     {
-      array[i]=(char *)malloc( stringLength * sizeof(char *) );
+      array[i]=(char *)malloc( stringLength * sizeof(char) );
     }
     array[ numStrings ] =  NULL; // we allocated +1 for hold the NULL part
 
-    strcpy( array[0], "dali-csharp-app");
+    std::string temp = "dali-csharp-app";
+    array[0][temp.copy(array[0], strlen(array[0])-1)] = '\0';
 
     arg1 = &argC;
     arg2 = &argV;
@@ -223,11 +225,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Application_New__SWIG_3(int jarg1, cha
     // allocate the string data
     for( int i=0; i < numStrings; i++)
     {
-      array[i]=(char *)malloc( stringLength * sizeof(char *) );
+      array[i]=(char *)malloc( stringLength * sizeof(char) );
     }
     array[ numStrings ] =  NULL; // we allocated +1 for hold the NULL part
 
-    strcpy( array[0], "dali-csharp-app");
+    std::string temp = "dali-csharp-app";
+    array[0][temp.copy(array[0], strlen(array[0])-1)] = '\0';
 
     arg1 = &argC;
     arg2 = &argV;
@@ -1427,11 +1430,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Application_New__SWIG_4(int jarg1, cha
     // allocate the string data
     for( int i=0; i < numStrings; i++)
     {
-      array[i]=(char *)malloc( stringLength * sizeof(char *) );
+      array[i]=(char *)malloc( stringLength * sizeof(char) );
     }
     array[ numStrings ] =  NULL; // we allocated +1 for hold the NULL part
 
-    strcpy( array[0], "dali-csharp-app");
+    std::string temp = "dali-csharp-app";
+    array[0][temp.copy(array[0], strlen(array[0])-1)] = '\0';
 
     arg1 = &argC;
     arg2 = &argV;
index ea2fb4f..76cff67 100755 (executable)
@@ -3720,21 +3720,18 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_DaliException(char * jarg1, char *
 
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_DaliException_location_set(void * jarg1, char * jarg2) {
   Dali::DaliException *arg1 = (Dali::DaliException *) 0 ;
-  char *arg2 = (char *) 0 ;
+  std::string arg2 = std::string(jarg2);
 
   arg1 = (Dali::DaliException *)jarg1;
-  arg2 = (char *)jarg2;
   {
-    if (arg2) {
-      arg1->location = (char const *) (new char[strlen((const char *)arg2)+1]);
-      strncpy((char *)arg1->location, (const char *)arg2, strlen((const char *)arg2));
+    if (!arg2.empty()) {
+      ((char *)(arg1->location))[arg2.copy((char*)(arg1->location), strlen(arg1->location)-1)] = '\0';
     } else {
       arg1->location = 0;
     }
   }
 }
 
-
 SWIGEXPORT char * SWIGSTDCALL CSharp_Dali_DaliException_location_get(void * jarg1) {
   char * jresult ;
   Dali::DaliException *arg1 = (Dali::DaliException *) 0 ;
@@ -3749,14 +3746,12 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Dali_DaliException_location_get(void * jarg
 
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_DaliException_condition_set(void * jarg1, char * jarg2) {
   Dali::DaliException *arg1 = (Dali::DaliException *) 0 ;
-  char *arg2 = (char *) 0 ;
+  std::string arg2 = std::string(jarg2);
 
   arg1 = (Dali::DaliException *)jarg1;
-  arg2 = (char *)jarg2;
   {
-    if (arg2) {
-      arg1->condition = (char const *) (new char[strlen((const char *)arg2)+1]);
-      strncpy((char *)arg1->condition, (const char *)arg2, strlen((const char *)arg2));
+    if (!arg2.empty()) {
+      ((char *)(arg1->condition))[arg2.copy((char*)(arg1->condition), strlen(arg1->condition)-1)] = '\0';
     } else {
       arg1->condition = 0;
     }