snprintf and linked server to be respawned, not copied one

This commit is contained in:
maliakal_d 2021-10-19 10:16:31 +02:00
parent 8db1dfb2ce
commit 6cf5072293
2 changed files with 5 additions and 5 deletions

View File

@ -367,7 +367,7 @@ int waitForFPGAtoTouchFlash(char *mess) {
// convert to int // convert to int
if (sscanf(retvals, "%d\n", &result) != 1) { if (sscanf(retvals, "%d\n", &result) != 1) {
sprintf(mess, snprintf(mess, MAX_STR_LENGTH,
"Could not program fpga. (could not scan int for gpio " "Could not program fpga. (could not scan int for gpio "
"status: [%s])\n", "status: [%s])\n",
retvals); retvals);

View File

@ -4301,7 +4301,7 @@ int copy_detector_server(int file_des) {
// add new link name to /etc/inittab // add new link name to /etc/inittab
if (ret == OK) { if (ret == OK) {
format = "echo 'ttyS0::respawn:/./%s' >> /etc/inittab"; format = "echo 'ttyS0::respawn:/./%s' >> /etc/inittab";
if (snprintf(cmd, MAX_STR_LENGTH, format, sname) >= if (snprintf(cmd, MAX_STR_LENGTH, format, LINKED_SERVER_NAME) >=
MAX_STR_LENGTH) { MAX_STR_LENGTH) {
ret = FAIL; ret = FAIL;
strcpy(mess, "Could not copy detector server. Command " strcpy(mess, "Could not copy detector server. Command "