snprintf(pname, PATH_MAX,
"does not exist now(may be dead without unlock)");
} else {
- read(fd_cmdline, pname, PATH_MAX);
+ int r;
+ r = read(fd_cmdline, pname, PATH_MAX);
+ if ((r >= 0) && (r < PATH_MAX))
+ pname[r] = '\0';
close(fd_cmdline);
}
"does not exist now"
"(may be dead without unlock)");
} else {
- read(fd_cmdline, pname, PATH_MAX);
+ int r;
+ r = read(fd_cmdline, pname, PATH_MAX);
+ if ((r >= 0) && (r < PATH_MAX))
+ pname[r] = '\0';
close(fd_cmdline);
}
snprintf(buf, sizeof(buf),
static void display_exit(void *data)
{
- int i;
+ int i = INIT_END;
status = DEVICE_OPS_STATUS_STOP;
end_battinfo_gathering();