[gvfs/gnome-2-26] FTP: parse file sizes > 4GB correctly



commit fe45df2ccfe43077d15c31e21f00f4fb98eea85c
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Thu May 7 15:17:06 2009 +0200

    FTP: parse file sizes > 4GB correctly
    
    Use 64-bit strtoull() instead of 32-bit strtoul()
    when converting string to number.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=499286
---
 daemon/gvfsbackendftp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index e650dd0..949573d 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -1239,7 +1239,7 @@ dir_default_iter_process (gpointer        iter,
   else if (symlink)
     *symlink = NULL;
 
-  g_file_info_set_size (info, strtoul (result.fe_size, NULL, 10));
+  g_file_info_set_size (info, g_ascii_strtoull (result.fe_size, NULL, 10));
 
   gvfs_file_info_populate_default (info, s,
 				   type == 'f' ? G_FILE_TYPE_REGULAR :
@@ -2231,7 +2231,7 @@ create_file_info (GVfsBackendFtp *ftp, FtpConnection *conn, const char *filename
 
           gvfs_file_info_populate_default (info, filename, G_FILE_TYPE_REGULAR);
 
-          g_file_info_set_size (info, strtoul (conn->read_buffer+4, NULL, 0));
+          g_file_info_set_size (info, g_ascii_strtoull (conn->read_buffer+4, NULL, 0));
 
           g_file_info_set_is_hidden (info, TRUE);
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]