Updating branch refs/heads/ristretto-0.3
         to 781504630508f1c03fde7fcc8f36fc4c5289e396 (commit)
       from 64bce8d2bda85e8f56c677131897b1b01c60bbd7 (commit)

commit 781504630508f1c03fde7fcc8f36fc4c5289e396
Author: Eric Koegel <[email protected]>
Date:   Fri Dec 21 09:30:52 2012 +0300

    Fixed an overflow when comparing filenames with large numbers in them. (Bug 
#9485)
    
    Signed-off-by: Stephan Arts <[email protected]>

 src/image_list.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/image_list.c b/src/image_list.c
index 70772d8..0e43590 100644
--- a/src/image_list.c
+++ b/src/image_list.c
@@ -994,8 +994,8 @@ cb_rstto_image_list_image_name_compare_func (RsttoFile *a, 
RsttoFile *b)
     const gchar *bp = b_base;
 
     gint result = 0;
-    guint a_num = 0;
-    guint b_num = 0;
+    guint64 a_num = 0;
+    guint64 b_num = 0;
 
     /* try simple (fast) ASCII comparison first */
     for (;; ++ap, ++bp)
@@ -1035,8 +1035,8 @@ cb_rstto_image_list_image_name_compare_func (RsttoFile 
*a, RsttoFile *b)
              */
             if (g_ascii_isdigit (ac) && g_ascii_isdigit (bc))
             {
-                a_num = strtoul (ap, NULL, 10); 
-                b_num = strtoul (bp, NULL, 10); 
+                a_num = strtoull (ap, NULL, 10);
+                b_num = strtoull (bp, NULL, 10);
 
                 if (a_num < b_num)
                     result = -1;
@@ -1049,8 +1049,8 @@ cb_rstto_image_list_image_name_compare_func (RsttoFile 
*a, RsttoFile *b)
                 g_ascii_isdigit (*(ap -1)) &&
                 g_ascii_isdigit (*(bp -1)) )
             {
-                a_num = strtoul (ap-1, NULL, 10); 
-                b_num = strtoul (bp-1, NULL, 10); 
+                a_num = strtoull (ap-1, NULL, 10);
+                b_num = strtoull (bp-1, NULL, 10);
 
                 if (a_num < b_num)
                     result = -1;
_______________________________________________
Xfce4-commits mailing list
[email protected]
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to