From c114901c948e3a9582fe98c2574f70e3f65fa2ae Mon Sep 17 00:00:00 2001 From: kangsan Date: Wed, 9 May 2018 18:13:04 +0900 Subject: [PATCH] Fix parameter in qsort fix third parameter in qsort function when sorting 'processes' array (sizeof(process*) -> sizeof(process)) --- fbq.c | 2 +- fcfs.c | 2 +- rr.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fbq.c b/fbq.c index e15af1d..9884037 100644 --- a/fbq.c +++ b/fbq.c @@ -430,7 +430,7 @@ int main(int argc, char *argv[]){ } } - qsort(processes, numberOfProcesses, sizeof(Process*), compareArrivalTime); + qsort(processes, numberOfProcesses, sizeof(Process), compareArrivalTime); // main execution loop while (numberOfProcesses){ diff --git a/fcfs.c b/fcfs.c index d1fe3b7..d8514c5 100644 --- a/fcfs.c +++ b/fcfs.c @@ -313,7 +313,7 @@ int main(){ } } - qsort(processes, numberOfProcesses, sizeof(Process*), compareArrivalTime); + qsort(processes, numberOfProcesses, sizeof(Process), compareArrivalTime); // main execution loop while (numberOfProcesses){ diff --git a/rr.c b/rr.c index aac3431..e1511e9 100644 --- a/rr.c +++ b/rr.c @@ -346,7 +346,7 @@ int main(int argc, char *argv[]){ } } - qsort(processes, numberOfProcesses, sizeof(Process*), compareArrivalTime); + qsort(processes, numberOfProcesses, sizeof(Process), compareArrivalTime); // main execution loop while (numberOfProcesses){