From ad58f81cd29a6d802e08a44d2a884d25d1a904fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Cabra?= Date: Fri, 25 Oct 2019 11:04:40 +0000 Subject: [PATCH] Aktualizovat "program.c --- program.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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; } }