#define DEFAULT_PAYLOAD_SIZE 8192
#define MAX_PAYLOAD_SIZE 65536
#define MKDIR_MODE (S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
+#define MAX_DIGITS_INT 10 // in decimal
unsigned int msize = MAX_PAYLOAD_SIZE;
snprintf(mount_opt, sizeof(mount_opt), "trans=virtio,version=9p2000.L,msize=%u", msize - P9_FCALL_SIZE);
-
ret = mount(tag, path, "9p", 0, mount_opt);
if (ret == -1)
{
int value = vconf_keynode_get_int(pKey);
LOGDEBUG("key = %s, value = %d(int)", vconf_keynode_get_name(pKey), value);
- char *buf = (char*)malloc(sizeof(int));
+ char *buf = (char*)malloc(MAX_DIGITS_INT + 1);
if (!buf) {
LOGERR("insufficient memory available");
return;
}
-
- sprintf(buf, "%d", vconf_keynode_get_int(pKey));
+ snprintf(buf, MAX_DIGITS_INT + 1, "%d", vconf_keynode_get_int(pKey));
send_to_ecs(IJTYPE_VCONF, GROUP_MEMORY, STATUS, buf);
free(buf);
while ((dir_ent = readdir(dirp)))
{
- sprintf(plugin_path, "%s/%s", EMULD_PLUGIN_DIR, dir_ent->d_name);
+ snprintf(plugin_path, sizeof(plugin_path), "%s/%s", EMULD_PLUGIN_DIR, dir_ent->d_name);
LOGDEBUG("Try to load plugin (%s)", plugin_path);
{
if (errno != EAGAIN)
{
- LOGERR("EAGAIN");
+ LOGERR("read failed. errno = %d", errno);
return;
}
}
ijcommand ijcmd;
readed = g_synbuf.read(ijcmd.cmd, ID_SIZE);
- LOGDEBUG("ij id : %s", ijcmd.cmd);
-
// TODO : check
if (readed < ID_SIZE)
return;
+ LOGDEBUG("ij id : %s", ijcmd.cmd);
+
// read header
readed = g_synbuf.read((char*)&ijcmd.msg, HEADER_SIZE);
if (readed < HEADER_SIZE)
send_default_mount_req();
ret = valid_hds_path((char*)HDS_DEFAULT_PATH);
- LOGINFO("check directory '/mnt/host' for default fileshare: %d", ret);
+ LOGINFO("check directory '%s' for default fileshare: %d", HDS_DEFAULT_PATH, ret);
ret = try_mount((char*)HDS_DEFAULT_TAG, (char*)HDS_DEFAULT_PATH);
- LOGINFO("try mount /mnt/host for default fileshare: %d", ret);
+ LOGINFO("try mount %s for default fileshare: %d", HDS_DEFAULT_PATH, ret);
if (ret == 0) {
send_to_ecs(IJTYPE_HDS, MSG_GROUP_HDS, HDS_ACTION_DEFAULT, (char*)HDS_DEFAULT_TAG);
}
ret = pthread_join(tid[TID_NETWORK], &retval);
if (ret < 0) {
- LOGERR("validate package pthread join is failed.");
+ LOGERR("message loop pthread join is failed.");
}
ret = pthread_join(conn_thread_t, &retval);
LOGWARN("Failed to allocate memory");
return false;
}
- strcpy(pMsgProc->name, name);
- strcpy(pMsgProc->cmd, cmd);
+ memset(pMsgProc, 0, sizeof(emuld_msgproc));
+ strncpy(pMsgProc->name, name, NAME_LEN - 1);
+ strncpy(pMsgProc->cmd, cmd, CMD_SIZE - 1);
pMsgProc->func = func;
pMsgProc->next = NULL;
pPrev->next = pMsgProc;
switch(x)
{
case 1: // double tap
- sprintf(command, "vconftool set -t int memory/private/sensor/800004 %d -i -f", SENSOR_MOTION_DOUBLETAP_DETECTION);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800004 %d -i -f", SENSOR_MOTION_DOUBLETAP_DETECTION);
systemcall(command);
// memset(command, '\0', sizeof(command));
// sprintf(command, "vconftool set -t int memory/private/sensor/800004 %d -i -f", SENSOR_MOTION_DOUBLETAP_NONE);
// systemcall(command);
break;
case 2: // shake start
- sprintf(command, "vconftool set -t int memory/private/sensor/800002 %d -i -f", SENSOR_MOTION_SHAKE_DETECTED);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800002 %d -i -f", SENSOR_MOTION_SHAKE_DETECTED);
systemcall(command);
memset(command, '\0', sizeof(command));
- sprintf(command, "vconftool set -t int memory/private/sensor/800002 %d -i -f", SENSOR_MOTION_SHAKE_CONTINUING);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800002 %d -i -f", SENSOR_MOTION_SHAKE_CONTINUING);
systemcall(command);
break;
case 3: // shake stop
- sprintf(command, "vconftool set -t int memory/private/sensor/800002 %d -i -f", SENSOR_MOTION_SHAKE_FINISHED);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800002 %d -i -f", SENSOR_MOTION_SHAKE_FINISHED);
systemcall(command);
break;
case 4: // snap x+
- sprintf(command, "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_POSITIVE_X);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_POSITIVE_X);
systemcall(command);
break;
case 5: // snap x-
- sprintf(command, "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_NEGATIVE_X);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_NEGATIVE_X);
systemcall(command);
break;
case 6: // snap y+
- sprintf(command, "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_POSITIVE_Y);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_POSITIVE_Y);
systemcall(command);
break;
case 7: // snap y-
- sprintf(command, "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_NEGATIVE_Y);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_NEGATIVE_Y);
systemcall(command);
break;
case 8: // snap z+
- sprintf(command, "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_POSITIVE_Z);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_POSITIVE_Z);
systemcall(command);
break;
case 9: // snap z-
- sprintf(command, "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_NEGATIVE_Z);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_NEGATIVE_Z);
systemcall(command);
break;
case 10: // snap left
- sprintf(command, "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_NEGATIVE_X);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_NEGATIVE_X);
systemcall(command);
break;
case 11: // snap right
- sprintf(command, "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_POSITIVE_X);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800001 %d -i -f", SENSOR_MOTION_SNAP_POSITIVE_X);
systemcall(command);
break;
case 12: // move to call (direct call)
- sprintf(command, "vconftool set -t int memory/private/sensor/800020 %d -i -f", SENSOR_MOTION_MOVE_MOVETOCALL);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/private/sensor/800020 %d -i -f", SENSOR_MOTION_MOVE_MOVETOCALL);
systemcall(command);
break;
default:
x = atoi(tmpbuf);
- sprintf(command, "vconftool set -t int memory/telephony/rssi %d -i -f", x);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/telephony/rssi %d -i -f", x);
systemcall(command);
return 0;
static bool get_tag_path(char* data, char** tag, char** path)
{
char token[] = "\n";
+ char *saveptr;
LOGINFO("get_tag_path data : %s", data);
- *tag = strtok(data, token);
+ *tag = strtok_r(data, token, &saveptr);
if (*tag == NULL) {
LOGERR("data does not have a correct tag: %s", data);
return false;
}
- *path = strtok(NULL, token);
+ *path = strtok_r(NULL, token, &saveptr);
if (*path == NULL) {
LOGERR("data does not have a correct path: %s", data);
return false;
LOGINFO("action: %d, data: %s", ijcmd->msg.action, data);
if (ijcmd->msg.action == 1) {
- if (pthread_create(&tid[TID_HDS_ATTACH], NULL, mount_hds, (void*)data) != 0) {
- if (!get_tag_path(data, &tag, &path)) {
- LOGERR("mount pthread_create fail - wrong tag or path.");
- return true;
- }
- LOGERR("mount hds pthread create fail!");
- send_to_ecs(IJTYPE_HDS, MSG_GROUP_HDS, 2, tag);
+ if (pthread_create(&tid[TID_HDS_ATTACH], NULL, mount_hds, (void*)data) == 0) {
+ return true;
+ }
+ LOGERR("mount hds pthread create fail!");
+ if (!get_tag_path(data, &tag, &path)) {
+ LOGERR("mount pthread_create fail - wrong tag or path.");
+ free(data);
+ return true;
}
+ send_to_ecs(IJTYPE_HDS, MSG_GROUP_HDS, 2, tag);
} else if (ijcmd->msg.action == 2) {
- if (pthread_create(&tid[TID_HDS_DETACH], NULL, umount_hds, (void*)data) != 0) {
- if (!get_tag_path(data, &tag, &path)) {
- LOGERR("umount pthread_create fail - wrong tag or path.");
- free(data);
- return true;
- }
- LOGERR("umount hds pthread create fail!");
- send_to_ecs(IJTYPE_HDS, MSG_GROUP_HDS, 4, tag);
+ if (pthread_create(&tid[TID_HDS_DETACH], NULL, umount_hds, (void*)data) == 0) {
+ return true;
}
+ LOGERR("umount hds pthread create fail!");
+ if (!get_tag_path(data, &tag, &path)) {
+ LOGERR("umount pthread_create fail - wrong tag or path.");
+ free(data);
+ return true;
+ }
+ send_to_ecs(IJTYPE_HDS, MSG_GROUP_HDS, 4, tag);
} else {
LOGERR("unknown action cmd.");
}
+
free(data);
return true;
}
message = (char*)malloc(5);
memset(message, 0, 5);
- ret = sprintf(message, "%d", mode);
+ ret = snprintf(message, 5, "%d", mode);
if (ret < 0) {
free(message);
message = 0;
message = (char*)malloc(256);
memset(message, 0, 256);
- ret = sprintf(message, "%d,%s", mode, temp);
+ ret = snprintf(message, 256, "%d,%s", mode, temp);
if (ret < 0) {
free(message);
message = 0;
message = (char*)malloc(128);
memset(message, 0, 128);
- ret = sprintf(message, "%d,%f,%f,%f,%f", mode, latitude, logitude, altitude, accuracy);
+ ret = snprintf(message, 128, "%d,%f,%f,%f,%f", mode, latitude, logitude, altitude, accuracy);
if (ret < 0) {
free(message);
message = 0;
return NULL;
}
- switch(param->ActionID)
+ switch (param->ActionID)
{
case LOCATION_STATUS:
msg = get_location_status((void*)packet);
free(tmp);
}
- if(msg != 0)
+ if (msg != 0)
{
free(msg);
msg = 0;
void setting_location(char* databuf)
{
- char* s = strchr(databuf, ',');
+ char *s = strchr(databuf, ',');
int err = 0;
+ char *saveptr;
if (s == NULL) { // SET MODE
int mode = atoi(databuf);
} else {
*s = '\0';
int mode = atoi(databuf);
- if(mode == 1) { // NMEA MODE (LOG MODE)
+ if (mode == 1) { // NMEA MODE (LOG MODE)
err = vconf_set_str(VCONF_FILENAME, s+1);
LOGFAIL(err, "Set FileName failed. name = %s", s+1);
err = vconf_set_int(VCONF_REPLAYMODE, mode);
LOGFAIL(err, "Set ReplayMode failed. mode = %d", mode);
} else if (mode == 2) {
- char* ptr = strtok(s+1, ",");
+ char* ptr = strtok_r(s+1, ",", &saveptr);
double value = 0.0;
// Latitude
LOGFAIL(err, "Set ManualLatitude failed. value = %f", value);
// Longitude
- ptr = strtok(NULL, ",");
+ ptr = strtok_r(NULL, ",", &saveptr);
value = atof(ptr);
err = vconf_set_dbl(VCONF_MLONGITUDE, value);
LOGFAIL(err, "Set ManualLongitude failed. value = %f", value);
// Altitude
- ptr = strtok(NULL, ",");
+ ptr = strtok_r(NULL, ",", &saveptr);
value = atof(ptr);
err = vconf_set_dbl(VCONF_MALTITUDE, value);
LOGFAIL(err, "Set ManualAltitude failed. value = %f", value);
// Accuracy
- ptr = strtok(NULL, ",");
+ ptr = strtok_r(NULL, ",", &saveptr);
value = atof(ptr);
err = vconf_set_dbl(VCONF_MHACCURACY, value);
LOGFAIL(err, "Set ManualHAccuracy failed. value = %f", value);
memset(buf, 0, sizeof(buf));
while(fgets(buf, sizeof(buf), fp)) {
- LOGINFO("[rpm]%s", buf);
+ LOGINFO("[rpm] %s", buf);
memset(buf, 0, sizeof(buf));
}
char *addon = NULL;
char *copy = strdup(data);
size_t remain;
+ char *saveptr;
if (copy == NULL) {
LOGERR("Failed to copy data.");
return;
memset(pkg_list, 0, sizeof(pkg_list));
- strcpy(pkg_list, "rm -rf ");
+ strncpy(pkg_list, "rm -rf ", sizeof("rm -rf "));
- strcat(pkg_list, PATH_PACKAGE_INSTALL);
- addon = strtok(copy, token);
+ strncat(pkg_list, PATH_PACKAGE_INSTALL, sizeof(PATH_PACKAGE_INSTALL));
+ addon = strtok_r(copy, token, &saveptr);
if (addon == NULL) {
LOGERR("Addon is null");
char *addon = NULL;
char pkg_list[MAX_PKGS_BUF];
size_t remain;
+ char *saveptr;
if (data == NULL) {
LOGERR("Add on package list is empty");
memset(pkg_list, 0, sizeof(pkg_list));
- strcpy(pkg_list, "rpm");
+ strncpy(pkg_list, "rpm", sizeof("rpm"));
if (action == 1) {
- strcat(pkg_list, " ");
- strcat(pkg_list, RPM_CMD_QUERY);
+ strncat(pkg_list, " ", sizeof(" "));
+ strncat(pkg_list, RPM_CMD_QUERY, sizeof(RPM_CMD_QUERY));
} else if (action == 2) {
- strcat(pkg_list, " ");
- strcat(pkg_list, RPM_CMD_INSTALL);
+ strncat(pkg_list, " ", sizeof(" "));
+ strncat(pkg_list, RPM_CMD_INSTALL, sizeof(RPM_CMD_INSTALL));
} else {
LOGERR("Unknown action.");
return false;
}
- addon = strtok(data, token); // for addon path
+ addon = strtok_r(data, token, &saveptr); // for addon path
if (addon == NULL) {
LOGERR("Addon is null");
return false;
}
- pkg = strtok(NULL, token);
+ pkg = strtok_r(NULL, token, &saveptr);
while (pkg != NULL) {
if (action == 1) {
pkg[strlen(pkg) - 4] = 0; //remove .rpm
}
- strcat(pkg_list, " ");
+ strncat(pkg_list, " ", sizeof(" "));
if (action == 2) {
- strcat(pkg_list, PATH_PACKAGE_INSTALL);
+ strncat(pkg_list, PATH_PACKAGE_INSTALL, sizeof(PATH_PACKAGE_INSTALL));
remain = MAX_PKGS_BUF - strnlen(pkg_list, MAX_PKGS_BUF) - strlen("/");
strncat(pkg_list, addon, remain - 1); // terminating null byte
- strcat(pkg_list, "/");
+ strncat(pkg_list, "/", sizeof("/"));
}
remain = MAX_PKGS_BUF - strnlen(pkg_list, MAX_PKGS_BUF) - strlen(" 2>&1");
strncat(pkg_list, pkg, remain - 1); // terminating null byte
- pkg = strtok(NULL, token);
+ pkg = strtok_r(NULL, token, &saveptr);
}
- strcat(pkg_list, " ");
- strcat(pkg_list, "2>&1");
+ strncat(pkg_list, " 2>&1", sizeof(" 2>&1"));
LOGINFO("[cmd] %s", pkg_list);
if (action == 1 && do_rpm_execute(pkg_list)) {
char *value = NULL;
vconf_res_type *vrt = (vconf_res_type*)data;
+ if (!vrt)
+ {
+ LOGERR("vconf data is null");
+ pthread_exit((void *) 0);
+ }
+
if (!check_possible_vconf_key(vrt->vconf_key)) {
- LOGERR("%s is not available key.");
+ LOGERR("%s is not available key.", vrt->vconf_key);
} else {
int length = get_vconf_status(&value, vrt->vconf_type, vrt->vconf_key);
if (length == 0 || !value) {
{
pthread_detach(pthread_self());
- vconf_res_type *vrt = (vconf_res_type*)data;
int val = -1;
+ vconf_res_type *vrt = (vconf_res_type*)data;
+
+ if (!vrt)
+ {
+ LOGERR("vconf data is null");
+ pthread_exit((void *) 0);
+ }
if (!check_possible_vconf_key(vrt->vconf_key)) {
- LOGERR("%s is not available key.");
+ LOGERR("%s is not available key.", vrt->vconf_key);
} else {
keylist_t *get_keylist;
keynode_t *pkey_node = NULL;
const int tmpsize = ijcmd->msg.length;
char token[] = "\n";
char tmpdata[tmpsize];
+ char *saveptr;
+ int vconf_key_size;
+ int vconf_val_size;
+
memcpy(tmpdata, ijcmd->data, tmpsize);
char* ret = NULL;
- ret = strtok(tmpdata, token);
+ ret = strtok_r(tmpdata, token, &saveptr);
if (!ret) {
LOGERR("vconf type is empty");
return true;
goto error;
}
- ret = strtok(NULL, token);
+ ret = strtok_r(NULL, token, &saveptr);
if (!ret) {
LOGERR("vconf key is empty");
goto error;
}
-
- vrt->vconf_key = (char*)malloc(strlen(ret) + 1);
+ vconf_key_size = strlen(ret);
+ vrt->vconf_key = (char*)malloc(vconf_key_size + 1);
if (!vrt->vconf_key) {
LOGERR("insufficient memory available");
goto error;
}
- sprintf(vrt->vconf_key, "%s", ret);
+ snprintf(vrt->vconf_key, vconf_key_size + 1, "%s", ret);
if (ijcmd->msg.action == VCONF_SET) {
- ret = strtok(NULL, token);
+ ret = strtok_r(NULL, token, &saveptr);
if (!ret) {
LOGERR("vconf value is empty");
goto error2;
}
- vrt->vconf_val = (char*)malloc(strlen(ret) + 1);
+ vconf_val_size = strlen(ret);
+ vrt->vconf_val = (char*)malloc(vconf_val_size + 1);
if (!vrt->vconf_val) {
LOGERR("insufficient memory available");
goto error2;
}
- sprintf(vrt->vconf_val, "%s", ret);
+ snprintf(vrt->vconf_val, vconf_val_size + 1, "%s", ret);
if (pthread_create(&tid[TID_VCONF], NULL, set_vconf_value, (void*)vrt) == 0) {
return true;
LOGERR("Socket open error");
return;
}
- strcpy(ifrq.ifr_name, "eth0");
+ strncpy(ifrq.ifr_name, "eth0", sizeof("eth0"));
while (ioctl(fd, SIOCGIFADDR, &ifrq) < 0) {
/* while to get ip address */
usleep(100);
int send_guide_me()
{
- sprintf(s1, "%s", "guide me");
+ snprintf(s1, 10, "%s", "guide me");
si_voice_result_data_s t_voice;
t_voice.handle = 0;
int send_describe()
{
- sprintf(s1, "%s", "describe");
+ snprintf(s1, 10, "%s", "describe");
si_voice_result_data_s t_voice;
t_voice.handle = 0;
int send_left()
{
- sprintf(s1, "%s", "left");
+ snprintf(s1, 10, "%s", "left");
si_voice_result_data_s t_voice;
t_voice.m_Domain = 20;
int send_right()
{
- sprintf(s1, "%s", "right");
+ snprintf(s1, 10, "%s", "right");
si_voice_result_data_s t_voice;
t_voice.m_Domain = 20;
int command, ret, data;
const int tmpsize = ijcmd->msg.length;
- char* data_p = NULL;
+ char *data_p = NULL;
char token[] = "\n";
char tmpdata[tmpsize+1];
- char* s_cnt = NULL;
+ char *s_cnt = NULL;
int cnt = 0;
+ char *saveptr;
if (!SI_INIT) {
ret = InitServer();
memset(tmpdata, 0, tmpsize+1);
memcpy(tmpdata, ijcmd->data, tmpsize);
- s_cnt = strtok(tmpdata, token);
+ s_cnt = strtok_r(tmpdata, token, &saveptr);
cnt = atoi(s_cnt);
- while(data_p = strtok(NULL, token)) {
+ while(data_p = strtok_r(NULL, token, &saveptr)) {
data = atoi(data_p);
}
printf("msgproc_gesture action : %d\n", ijcmd->msg.action);
}
/* get hdmi plugged state */
for (i = 0; i < HDMI_CNT; i++) {
- sprintf(command, "memory/sysman/hdmi%d", i+1);
+ snprintf(command, sizeof(command), "memory/sysman/hdmi%d", i+1);
if (vconf_get_int(command, &onoff_state)) {
onoff_state = 0;
}
}
/* get av plugged state */
for (i = 0; i < AV_CNT; i++) {
- sprintf(command, "memory/sysman/av%d", i+1);
+ snprintf(command, sizeof(command), "memory/sysman/av%d", i+1);
if (vconf_get_int(command, &onoff_state)) {
onoff_state = 0;
}
}
/* get comp plugged state */
for (i = 0; i < COMP_CNT; i++) {
- sprintf(command, "memory/sysman/comp%d", i+1);
+ snprintf(command, sizeof(command), "memory/sysman/comp%d", i+1);
if (vconf_get_int(command, &onoff_state)) {
onoff_state = 0;
}
packet->group = 15;
packet->action = 211;
memcpy(tmp, packet, HEADER_SIZE);
- sprintf(command, "%d:%d:%d:%d:%d:%d:%d:%d:",
+ snprintf(command, sizeof(command), "%d:%d:%d:%d:%d:%d:%d:%d:",
extinput[0], extinput[1], extinput[2], extinput[3], extinput[4], extinput[5], extinput[6], extinput[7]);
memcpy(tmp + HEADER_SIZE, command, packet->length);
ijmsg_send_to_evdi(g_fd[fdtype_device], IJTYPE_EI, (const char *)tmp, tmplen);
char *section = NULL;
unsigned int number = 0;
unsigned int state = 0;
+ char *saveptr;
memset(plugged, '\0', sizeof(plugged));
memcpy(plugged, ijcmd->data, ijcmd->msg.length);
- section = strtok(plugged, token);
+ section = strtok_r(plugged, token, &saveptr);
number = (unsigned int)atoi(section);
- section = strtok(NULL, token);
+ section = strtok_r(NULL, token, &saveptr);
state = (unsigned int)atoi(section);
if (number > MAX_EXTINPUT_COUNT) {
case EXTINPUT_HDMI2:
case EXTINPUT_HDMI3:
case EXTINPUT_HDMI4:
- sprintf(command, "vconftool set -t int memory/sysman/hdmi%d %d -i -f", number, state);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/sysman/hdmi%d %d -i -f", number, state);
break;
case EXTINPUT_AV1:
- sprintf(command, "vconftool set -t int memory/sysman/av1 %d -i -f", state);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/sysman/av1 %d -i -f", state);
break;
case EXTINPUT_AV2:
- sprintf(command, "vconftool set -t int memory/sysman/av2 %d -i -f", state);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/sysman/av2 %d -i -f", state);
break;
case EXTINPUT_COMP1:
- sprintf(command, "vconftool set -t int memory/sysman/comp1 %d -i -f", state);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/sysman/comp1 %d -i -f", state);
break;
case EXTINPUT_COMP2:
- sprintf(command, "vconftool set -t int memory/sysman/comp2 %d -i -f", state);
+ snprintf(command, sizeof(command), "vconftool set -t int memory/sysman/comp2 %d -i -f", state);
break;
}
extinput[number-1] = state;