This is not more complicated than the strncpy(), and it allows for
arbitrary long task names.
struct task {
/** The task name supplied when the task was registered(). */
- char name[255];
+ char *name;
/** Copied from the task_info struct during task_register(). */
void (*pre_select)(struct sched *s, struct task *t);
/** Copied from the task_info struct during task_register(). */
{
PARA_INFO_LOG("freeing task %s\n", t->name);
list_del(&t->node);
+ free(t->name);
free(t);
}
if (!s->task_list.next)
INIT_LIST_HEAD(&s->task_list);
- snprintf(t->name, sizeof(t->name) - 1, "%s", info->name);
- t->name[sizeof(t->name) - 1] = '\0';
+ t->name = para_strdup(info->name);
t->notification = 0;
t->status = 0;
t->dead = false;