Fix the issue detected with static analyzer tool 44/89044/2
authorsungwook79.park <sungwook79.park@samsung.com>
Thu, 22 Sep 2016 00:48:22 +0000 (09:48 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Thu, 22 Sep 2016 01:02:57 +0000 (10:02 +0900)
Change-Id: I365b22186edf5b586276efcc6f74743cdc795ffe
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
src/ise-stt-mode.cpp

index efc8606..308d4c4 100644 (file)
@@ -48,9 +48,8 @@ void voice_result_string_flush()
 {
     LOGD("***** result_text : %s *******", my_voicedata->partial_result);
     if (my_voicedata->partial_result) {
-        char *retStr = (char *)calloc(strlen(my_voicedata->partial_result) + 2, sizeof(char));
-        strcpy(retStr, my_voicedata->partial_result);
-        strcat(retStr, " ");
+        char *retStr = (char *)calloc(strlen(my_voicedata->partial_result) + 1, sizeof(char));
+        strncpy(retStr, my_voicedata->partial_result, strlen(my_voicedata->partial_result));
         ise_send_string(retStr);
         free(retStr);
     }