switch (mode) {
case APP_CONTROL_LAUNCH_MODE_SINGLE:
- strncpy(launch_mode, LAUNCH_MODE_SINGLE, strlen(LAUNCH_MODE_SINGLE));
+ strncpy(launch_mode, LAUNCH_MODE_SINGLE, sizeof(launch_mode) - 1);
break;
case APP_CONTROL_LAUNCH_MODE_GROUP:
- strncpy(launch_mode, LAUNCH_MODE_GROUP, strlen(LAUNCH_MODE_GROUP));
+ strncpy(launch_mode, LAUNCH_MODE_GROUP, sizeof(launch_mode) - 1);
break;
default:
return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,