Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Correclty handle the case p1 < p2 in cmpstringp.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 29 Nov 2011 10:36:47 +0000 (11:36 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 29 Nov 2011 10:38:28 +0000 (11:38 +0100)
tools/tesh/run_context.c

index fcf6d3c..1eaaedf 100644 (file)
@@ -653,7 +653,7 @@ static int cmpstringp(const void *p1, const void *p2) {
 
   int res = strncmp(s1, s2, sort_len);
   if (res == 0)
-    return p1>p2;
+    res = p1 > p2 ? 1 : (p1 < p2 ? -1 : 0);
   return res;
 }