mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
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.
[originally from svn r9637]
[r9636 == 538090ede4
]
This commit is contained in:
parent
538090ede4
commit
03ebc74b9f
6
timing.c
6
timing.c
@ -62,7 +62,11 @@ static int compare_timers(void *av, void *bv)
|
|||||||
*/
|
*/
|
||||||
#if defined(__LCC__) || defined(__clang__)
|
#if defined(__LCC__) || defined(__clang__)
|
||||||
/* lcc won't let us compare function pointers. Legal, but annoying. */
|
/* 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
|
#else
|
||||||
if (a->fn < b->fn)
|
if (a->fn < b->fn)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user