diff --git a/program.c b/program.c index 0b80c3f..c44ed52 100644 --- a/program.c +++ b/program.c @@ -27,11 +27,10 @@ int compare_pizza(const void * left, const void * right) { while(1){ if(a->name[i]=='\n' || b->name[i]=='\n'){ break; - } - else if(a->name[i]=='\r' || b->name[i]=='\r'){ + } + else if(a->name[i]=='\r' || b->name[i]=='\r'){ break; - } - + } else if(a->name[i] > b->name[i]){ return 1; } @@ -40,7 +39,7 @@ int compare_pizza(const void * left, const void * right) { } } - return -1; + return 0; } }