Re: [PHP-CVS] Re: cvs: php-src /ext/ftp ftp.c

2004-02-21 Thread Ard Biesheuvel
[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

Re: [PHP-CVS] Re: cvs: php-src /ext/ftp ftp.c

2004-02-21 Thread Ard Biesheuvel
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

Re: [PHP-CVS] Re: cvs: php-src /ext/ftp ftp.c

2004-02-21 Thread Ard Biesheuvel
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

Re: [PHP-CVS] Re: cvs: php-src /ext/ftp ftp.c

2004-02-21 Thread Sara Golemon
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

Re: [PHP-CVS] Re: cvs: php-src /ext/ftp ftp.c

2004-02-20 Thread Andi Gutmans
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 */ +

Re: [PHP-CVS] Re: cvs: php-src /ext/ftp ftp.c

2004-02-20 Thread Ard Biesheuvel
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 */ +

Re: [PHP-CVS] Re: cvs: php-src /ext/ftp ftp.c

2004-02-20 Thread Sara Golemon
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