]> git.pond.sub.org Git - empserver/commit
w32/strptime: Fix for 64 bit pointers
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 5 Apr 2015 07:45:11 +0000 (09:45 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 14 May 2015 07:39:19 +0000 (09:39 +0200)
commita455169edd43bb28d2929210496c855292b4b431
tree18c8a3c8edebe640aa0d758698f9b5f6708cfebd
parent953ff83fb164175082ff62967d2569d3b23d026b
w32/strptime: Fix for 64 bit pointers

The __UNCONST() stolen from NetBSD assumes unsigned long can hold a
pointer.  Not true with Win64's LLP64 data model.  There, we cast the
64 bit pointer to 32 bits and back.  Works only because Windows puts
the stack at a very low address, and the casts don't actually change
the pointer.

Dumb it down to a straight cast to void * for safety.

Thanks to Harald Katzer and Ron Koenderink for their help figuring out
the bug's impact.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/w32/strptime.c