diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -312,14 +312,14 @@ void add_job_to_queue(struct distrenjob struct distrenjob *current_job; // create pointer to current_job (which job is being compared to) // iterate through linked list of jobs - for(current_job = head; current_job != NULL; current_job = current_job.next){ + for(current_job = head; current_job != NULL; current_job = current_job->next){ if(current_job == NULL){ // if it has reached the end of the list, add job there current_job = job; break; } - else if(job.priority < current_job.priority){ // if job's priority is less than current_job's priority, insert job - prev_job.next = job; // keep in mind 1 is the lowest priority - job.next = current_job; + else if(job->priority < current_job->priority){ // if job's priority is less than current_job's priority, insert job + prev_job->next = job; // keep in mind 1 is the lowest priority + job->next = current_job; break; } } // end of for statement