From d2d119128a6e5c1d0a72d3812f9fb85a4e1e890d Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 28 Aug 2012 17:41:10 +0000 Subject: [PATCH] Partially revert r9636. It is true that we can directly return the result of memcmp, but untrue that we can do so _unconditionally_: if memcmp returns zero, we still need to fall through to the next comparison. git-svn-id: svn://svn.tartarus.org/sgt/putty@9637 cda61777-01e9-0310-a592-d414129be87e --- timing.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/timing.c b/timing.c index 9c2a8787..ffea4e14 100644 --- a/timing.c +++ b/timing.c @@ -62,7 +62,11 @@ static int compare_timers(void *av, void *bv) */ #if defined(__LCC__) || defined(__clang__) /* lcc won't let us compare function pointers. Legal, but annoying. */ - return memcmp(&a->fn, &b->fn, sizeof(a->fn)); + { + int c = memcmp(&a->fn, &b->fn, sizeof(a->fn)); + if (c) + return c; + } #else if (a->fn < b->fn) return -1; -- 2.11.0