prs_uint32 applied to pointers?

Mikhail Teterin mi+kde at aldan.algebra.com
Thu May 17 11:54:54 GMT 2007


On Wednesday 16 May 2007 20:32, Jeremy Allison wrote:
= >        uni_p = fl3->path ? (uint32)fl3->path : 0;
= >        if(!prs_uint32("ptr", ps, depth, &uni_p))
= >                return False;
= > 
= > Although the 32-bit systems will not notice, the code does not seem 
= > right for 64-bit ones, where pointers are 64-bit wide. Can someone, 
= > please, comment? Silencing the warning is easy, but there may be a 
= > genuine problem pointed out here.
= 
= Actually it should be putting "1" here as all that matters is
= that the pointer is non-zero.

The way things are now, it could be getting it wrong every once in a while, 
when the lower 32-bits of the pointer happen to be zeros. :-(

How about:

	uni_p = (fl3->path != NULL);

Yours,

	-mi


More information about the samba-technical mailing list