summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Esser <sesser@php.net>2002-10-04 21:58:39 +0000
committerStefan Esser <sesser@php.net>2002-10-04 21:58:39 +0000
commit87c0577a0c250f45ddf40bb5a663c04d71847adc (patch)
tree68ef7689137210b8f82d2a299ad605abe47fc576
parent29be52fbfb7ab44f0ec6c89d1a607f9fdbc927b9 (diff)
downloadphp-git-87c0577a0c250f45ddf40bb5a663c04d71847adc.tar.gz
some broken ftp servers return 32bit port numbers.
-rw-r--r--ext/standard/ftp_fopen_wrapper.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index f81f23f4cf..e852c9a923 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -352,7 +352,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
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 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
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 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
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) {