mirror of https://git.48k.eu/ogserver
#1051 Initialize task_id once in og_cmd_post_schedule_command
Fixes task_id re-initialization in commit 33d8cecfe
.
Task id is to be initialized with the "session" value and can be done
out of the for loop it was before. Avoiding unnecesary snprintf's with
the same value.
master
parent
261d490c4e
commit
8190c6f6df
16
src/rest.c
16
src/rest.c
|
@ -4848,16 +4848,16 @@ static int og_cmd_post_schedule_command(json_t *element,
|
|||
goto err_dbi_result;
|
||||
}
|
||||
dbi_result_free(result);
|
||||
|
||||
len = snprintf(task_id, sizeof(sequence), "%d", sequence);
|
||||
if (len >= (int)sizeof(task_id)) {
|
||||
syslog(LOG_ERR, "truncated snprintf (%s:%d)\n",
|
||||
__func__, __LINE__);
|
||||
goto err_dbi;
|
||||
}
|
||||
params->task_id = task_id;
|
||||
}
|
||||
|
||||
len = snprintf(task_id, sizeof(session), "%d", session);
|
||||
if (len >= (int)sizeof(task_id)) {
|
||||
syslog(LOG_ERR, "truncated snprintf (%s:%d)\n",
|
||||
__func__, __LINE__);
|
||||
goto err_dbi_result;
|
||||
}
|
||||
params->task_id = task_id;
|
||||
|
||||
og_task_schedule_create(params);
|
||||
|
||||
free((char *)legacy_params);
|
||||
|
|
Loading…
Reference in New Issue