Skip to content
Snippets Groups Projects
Commit 99798b0b authored by Morris Jette's avatar Morris Jette
Browse files

Fixes for newly reported Coverity errors

All of these were pre-existing Coverity errors, but I changed nearby
code, variable names, etc. so they looked like new errors.
parent 69811072
No related branches found
No related tags found
No related merge requests found
......@@ -1684,7 +1684,7 @@ cpu_freq_debug(char* label, char* noval_str, char* freq_str, int freq_len,
strcpy(bfgov, "Governor=");
cpu_freq_to_string(&bfgov[9], (sizeof(bfgov)-9), gov);
} else if (noval_str) {
if (strlen(noval_str) >= sizeof(bfmax)) {
if (strlen(noval_str) >= sizeof(bfgov)) {
error("%s: max CPU governor string too large",
__func__);
} else {
......
......@@ -562,10 +562,7 @@ static int _addto_step_list_internal(List step_list, char *names,
if ((under = strstr(name, "_"))) {
*under++ = 0;
/* INFINITE means give me all the tasks of the array */
if (!under)
selected_step->array_task_id = INFINITE;
else if (isdigit(*under))
if (isdigit(*under))
selected_step->array_task_id = atoi(under);
else
fatal("Bad job array element specified: %s", name);
......
......@@ -203,18 +203,8 @@ static int _addto_job_list(List job_list, char *names)
selected_step->pack_job_offset = NO_VAL;
if ((under = strstr(name, "_"))) {
*under++ = 0;
/* INFINITE means give
* me all the tasks of
* the array */
if (!under) {
selected_step->
array_task_id =
INFINITE;
} else {
selected_step->
array_task_id =
atoi(under);
}
selected_step->array_task_id =
atoi(under);
} else if ((plus = strstr(name, "+"))) {
*plus++ = 0;
selected_step->pack_job_offset =
......@@ -277,18 +267,7 @@ static int _addto_job_list(List job_list, char *names)
selected_step->pack_job_offset = NO_VAL;
if ((under = strstr(name, "_"))) {
*under++ = 0;
/* INFINITE means give
* me all the tasks of
* the array */
if (!dot) {
selected_step->
array_task_id =
INFINITE;
} else {
selected_step->
array_task_id =
atoi(under);
}
selected_step->array_task_id = atoi(under);
} else if ((plus = strstr(name, "+"))) {
*plus++ = 0;
selected_step->pack_job_offset = atoi(plus);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment