On February 1, 2010 8:39:25 PM +0100 Alan DeKok <aland@deployingradius.com> wrote:
Frank Cusack wrote:
Yup. If anything, the patch should use the inttypes.h specifiers (PRId32 et al), not changing from one platform-specific format to another. Well I'm assuming that packet->data_len is a fixed-size type like int32. If it is in fact a long than %ld is correct, ovbiously.
I took a look... it's size_t. Which is 0-4K for any RADIUS packet.
The "portable" fix is to change %ld to %d, and to add an explicit cast: (int) packet->data_len.
There is a size_t printf format specifier. %z I think. Barring that, since size_t is probably "at least" 32 bits and int is only guaranteed to be 16 bits, and also since size_t is unsigned, the more correct fix would be casting to unsigned long. But %z if that is correct is better. -frank