[My apologies if you think I'm taking this too far]
What about nuking the ipbox altogether and doing
sin-sin_addr.s_addr = b[0] 24 | b[1] 16 | b[2] 8 | b[3];
sin-sin_port = (unsigned short)(b[4] 8 | b[5]);
(and using int[] instead of long int[] for b, so it will not generate
any warnings
Ard Biesheuvel wrote:
[My apologies if you think I'm taking this too far]
What about nuking the ipbox altogether and doing
sin-sin_addr.s_addr = b[0] 24 | b[1] 16 | b[2] 8 | b[3];
sin-sin_port = (unsigned short)(b[4] 8 | b[5]);
(and using int[] instead of long int[] for b, so it will not
Ard Biesheuvel wrote:
[My apologies if you think I'm taking this too far]
What about nuking the ipbox altogether and doing
sin-sin_addr.s_addr = b[0] 24 | b[1] 16 | b[2] 8 | b[3];
sin-sin_port = (unsigned short)(b[4] 8 | b[5]);
(and using int[] instead of long int[] for b, so it will not
sin-sin_addr.s_addr = b[0] 24 | b[1] 16 | b[2] 8 | b[3];
sin-sin_port = (unsigned short)(b[4] 8 | b[5]);
(and using int[] instead of long int[] for b, so it will not generate
any warnings unless sizeof(int) 4)
hontl will generate a long which once again has a platform
At 23:16 20/02/2004 +0100, Ard Biesheuvel wrote:
Sara Golemon wrote:
pollita Fri Feb 20 16:05:37 2004 EDT
Modified files:
/php-src/ext/ftpftp.c Log:
s_addr is always unsigned 32bit, long is not.
+ /* Deal with differing integer sizes */
+
Andi Gutmans wrote:
At 23:16 20/02/2004 +0100, Ard Biesheuvel wrote:
Sara Golemon wrote:
pollita Fri Feb 20 16:05:37 2004 EDT
Modified files:
/php-src/ext/ftpftp.c Log:
s_addr is always unsigned 32bit, long is not.
+ /* Deal with differing integer sizes */
+
After taking a second look, I realised my suggestion is incorrect. Byte
order is not an issue here, because sin-sin_addr.s_addr and the ipbox
are both in network byte order. Couldn't you just replace the long
member in the union by an integer ? (Just like the bug reporter suggested
?)
Some