~vcs-imports/putty/master

Viewing all changes in revision 5532.

  • Committer: Simon Tatham
  • Date: 2019-08-11 13:06:53 UTC
  • Revision ID: git-v1:50853ddcc3f78cf28b84704abcd686ab865d4089
winnet.c: improve 64-bit-cleanness in cmpfortree.

Commit f2e61275f converted the integer casts in cmpforsearch to
uintptr_t from unsigned long. But it left the companion function
cmpfortree alone, presumably on the grounds that the compiler didn't
report a warning for that one.

But those two functions (cmpfortree and cmpforsearch) are used with
the same tree234, so they're supposed to implement the same sorting
criterion. And the thing they're actually comparing, namely the
Windows API typedef SOCKET, is a pointer-sized integer. So there was a
latent bug here in which cmpforsearch was comparing all 64 bits of the
pointer, while cmpfortree was only comparing the low-order 32.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: