Change-Id: I2675f9d10a0e01ef334c68052e488fadec658a2d
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
{
char buf[NAME_MAX];
- if (sprintf(buf, "%d process", pid) < 1) {
+ if (snprintf(buf, sizeof(buf), "%d process", pid) < 1) {
return false;
}
char file_name[50];
for (i = 0; i < MAXSIZE; i++) {
- sprintf(file_name, "output_%d", sensors[i]);
+ snprintf(file_name, sizeof(file_name), "output_%d", sensors[i]);
file_output[i] = fopen(file_name, "w+");
sensor_t sensor = sensord_get_sensor(sensors[i]);
handle[i] = sensord_connect(sensor);
for (j = 0; j < MAX; j++) {
char command[100];
- sprintf(command, "kill %d", pids[j]);
+ snprintf(command, sizeof(command), "kill %d", pids[j]);
if (system(command) == -1)
return -1;
}