cvs: php4 /ext/standard ftp_fopen_wrapper.c
| From: | Stefan Esser | Date: | Fri, 04 Oct 2002 21:58:39 +0000 |
| Subject: | cvs: php4 /ext/standard ftp_fopen_wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-14556@lists.php.net to get a copy of this message | ||
sesser Fri Oct 4 17:58:39 2002 EDT
Modified files:
/php4/ext/standard ftp_fopen_wrapper.c
Log:
some broken ftp servers return 32bit port numbers.
Index: php4/ext/standard/ftp_fopen_wrapper.c
diff -u php4/ext/standard/ftp_fopen_wrapper.c:1.35 php4/ext/standard/ftp_fopen_wrapper.c:1.36
--- php4/ext/standard/ftp_fopen_wrapper.c:1.35 Thu Sep 26 06:14:41 2002
+++ php4/ext/standard/ftp_fopen_wrapper.c Fri Oct 4 17:58:39 2002
@@ -17,7 +17,7 @@
| Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: ftp_fopen_wrapper.c,v 1.35 2002/09/26 10:14:41 wez Exp $ */
+/* $Id: ftp_fopen_wrapper.c,v 1.36 2002/10/04 21:58:39 sesser Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -352,7 +352,7 @@
hoststart = ip;
/* pull out the MSB of the port */
- portno = (unsigned short) strtol(tpath, &ttpath, 10) * 256;
+ portno = (unsigned short) strtoul(tpath, &ttpath, 10) * 256;
if (ttpath == NULL) {
/* didn't get correct response from PASV */
goto errexit;
@@ -362,7 +362,7 @@
goto errexit;
tpath++;
/* pull out the LSB of the port */
- portno += (unsigned short) strtol(tpath, &ttpath, 10);
+ portno += (unsigned short) strtoul(tpath, &ttpath, 10);
} else {
/* parse epsv command (|||6446|) */
for (i = 0, tpath = tmp_line + 4; *tpath; tpath++) {
@@ -375,7 +375,7 @@
if (i < 3)
goto errexit;
/* pull out the port */
- portno = (unsigned short) strtol(tpath + 1, &ttpath, 10);
+ portno = (unsigned short) strtoul(tpath + 1, &ttpath, 10);
}
if (ttpath == NULL) {