Fix misused strncpy calls 30/139530/3
authorSemun Lee <semun.lee@samsung.com>
Wed, 19 Jul 2017 08:32:47 +0000 (17:32 +0900)
committerSemun Lee <semun.lee@samsung.com>
Wed, 19 Jul 2017 09:02:15 +0000 (18:02 +0900)
Change-Id: Iaa2366a447d26e568613ae257dd639dc06917408
Signed-off-by: Semun Lee <semun.lee@samsung.com>
app_control/app_control.c

index 55eda27..6d51d44 100755 (executable)
@@ -555,7 +555,7 @@ int app_control_clone(app_control_h *clone, app_control_h app_control)
 int app_control_set_launch_mode(app_control_h app_control,
                app_control_launch_mode_e mode)
 {
-       char launch_mode[LAUNCH_MODE_SIZE] = { 0, };
+       const char *launch_mode;
 
        if (app_control_validate(app_control)) {
                return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
@@ -564,10 +564,10 @@ int app_control_set_launch_mode(app_control_h app_control,
 
        switch (mode) {
        case APP_CONTROL_LAUNCH_MODE_SINGLE:
-               strncpy(launch_mode, LAUNCH_MODE_SINGLE, strlen(LAUNCH_MODE_SINGLE));
+               launch_mode = LAUNCH_MODE_SINGLE;
                break;
        case APP_CONTROL_LAUNCH_MODE_GROUP:
-               strncpy(launch_mode, LAUNCH_MODE_GROUP, strlen(LAUNCH_MODE_GROUP));
+               launch_mode = LAUNCH_MODE_GROUP;
                break;
        default:
                return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,