From: Arnaud Giersch Date: Tue, 29 Nov 2011 10:36:47 +0000 (+0100) Subject: Correclty handle the case p1 < p2 in cmpstringp. X-Git-Tag: exp_20120216~241^2~39 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/91f260c9156a5cc85fde97570ff25011aff05979 Correclty handle the case p1 < p2 in cmpstringp. --- diff --git a/tools/tesh/run_context.c b/tools/tesh/run_context.c index fcf6d3cec1..1eaaedfdc6 100644 --- a/tools/tesh/run_context.c +++ b/tools/tesh/run_context.c @@ -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; }