From 89dbcc1cccb24b09326f3a371c4d0fe86160d9f1 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 1 Mar 2022 17:54:29 +0100 Subject: [PATCH] avoid crash in vxWorks 6 when SNL name is long --- src/sequencer/seq_task.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/sequencer/seq_task.c b/src/sequencer/seq_task.c index 656a136ec..078c8366f 100644 --- a/src/sequencer/seq_task.c +++ b/src/sequencer/seq_task.c @@ -76,7 +76,6 @@ char *pTaskName; /* Parent task name */ char task_name[TASK_NAME_SIZE+10]; extern VOID ss_entry(); extern int seqAuxTaskId; - pSP->taskId = taskIdSelf(); /* my task id */ pSS = pSP->pSS; pSS->taskId = pSP->taskId; @@ -90,15 +89,11 @@ char *pTaskName; /* Parent task name */ /* Initiate connect & monitor requests to database channels. */ seq_connect(pSP); - /* Additional state set task names are derived from the first ss */ - if (strlen(pTaskName) > TASK_NAME_SIZE) - pTaskName[TASK_NAME_SIZE] = 0; - /* Create each additional state set task */ for (nss = 1, pSS = pSP->pSS + 1; nss < pSP->numSS; nss++, pSS++) { /* Form task name from program name + state set number */ - sprintf(task_name, "%s_%d", pTaskName, nss); + sprintf(task_name, "%.*s_%d", TASK_NAME_SIZE, pTaskName, nss); /* Spawn the task */ task_id = taskSpawn(