php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #55857
Patch ftp_size_large_file revision 2011-10-06 07:55 UTC by websupport at osite dot de

Patch ftp_size_large_file for FTP related Bug #55857

Patch version 2011-10-06 07:55 UTC

Return to Bug #55857 | Download this patch
Patch Revisions:

Developer: websupport@osite.de

Index: ext/ftp/ftp.h
===================================================================
--- ext/ftp/ftp.h	(Revision 317822)
+++ ext/ftp/ftp.h	(Arbeitskopie)
@@ -177,7 +177,7 @@
 int		ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC);
 
 /* returns the size of the given file, or -1 on error */
-int		ftp_size(ftpbuf_t *ftp, const char *path);
+long		ftp_size(ftpbuf_t *ftp, const char *path);
 
 /* returns the last modified time of the given file, or -1 on error */
 time_t		ftp_mdtm(ftpbuf_t *ftp, const char *path);
Index: ext/ftp/php_ftp.c
===================================================================
--- ext/ftp/php_ftp.c	(Revision 317822)
+++ ext/ftp/php_ftp.c	(Arbeitskopie)
@@ -1224,7 +1224,7 @@
 }
 /* }}} */
 
-/* {{{ proto int ftp_size(resource stream, string filename)
+/* {{{ proto long ftp_size(resource stream, string filename)
    Returns the size of the file, or -1 on error */
 PHP_FUNCTION(ftp_size)
 {
Index: ext/ftp/ftp.c
===================================================================
--- ext/ftp/ftp.c	(Revision 317822)
+++ ext/ftp/ftp.c	(Arbeitskopie)
@@ -960,7 +960,7 @@
 
 /* {{{ ftp_size
  */
-int
+long
 ftp_size(ftpbuf_t *ftp, const char *path)
 {
 	if (ftp == NULL) {
@@ -975,7 +975,7 @@
 	if (!ftp_getresp(ftp) || ftp->resp != 213) {
 		return -1;
 	}
-	return atoi(ftp->inbuf);
+	return atol(ftp->inbuf);
 }
 /* }}} */
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC