[gnome-desktop] bg-slide-show: Always parse date/time integers in base 10



commit db0e20607050c7c859446420905cc8680249554a
Author: Sebastian Keller <skeller gnome org>
Date:   Thu Feb 25 02:28:52 2021 +0100

    bg-slide-show: Always parse date/time integers in base 10
    
    People might prefix their dates/times with 0 which leads to the number
    being interpreted as octal value. This can then lead to "08" being
    interpreted as 0, because 8 is not a valid octal value. This is also
    much more likely than people intentionally trying to use octal or hex
    values for dates/times.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-desktop/-/issues/189

 libgnome-desktop/gnome-bg-slide-show.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libgnome-desktop/gnome-bg-slide-show.c b/libgnome-desktop/gnome-bg-slide-show.c
index 760ed566..e5a60fa5 100644
--- a/libgnome-desktop/gnome-bg-slide-show.c
+++ b/libgnome-desktop/gnome-bg-slide-show.c
@@ -359,7 +359,7 @@ stack_is (GnomeBGSlideShow *self,
 static int
 parse_int (const char *text)
 {
-        return strtol (text, NULL, 0);
+        return strtol (text, NULL, 10);
 }
 
 static void


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