From 91f260c9156a5cc85fde97570ff25011aff05979 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 29 Nov 2011 11:36:47 +0100 Subject: [PATCH] Correclty handle the case p1 < p2 in cmpstringp. --- tools/tesh/run_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.20.1