diff --git a/program.c b/program.c index cfd22d5..8127828 100644 --- a/program.c +++ b/program.c @@ -23,12 +23,24 @@ int compare_pizza(const void * left, const void * right) { return -1; } else{ - if(a->name[0] > b->name[0]){ + i=0; + while(1){ + if(a->name[i]=='\n' || b->name[i]=='\n'){ + break; + } + else if(a->name[i]=='\r' || b->name[i]=='\r'){ + break; + } + + else if(a->name[i] > b->name[i]){ return 1; + } + else{ + i++ + } + } - else{ - return -1; - } + return -1; } }