[gnome-calendar/date-selector] date-selector: use atoi instead of strtol



commit b5666752410e4cc99a1e9d7b889f0b4dcae784be
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Dec 23 12:37:57 2014 -0200

    date-selector: use atoi instead of strtol
    
    This prevents the pseudo-bug where strtol thinks the date is in octal because of the leading zeros.

 src/gcal-date-selector.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-date-selector.c b/src/gcal-date-selector.c
index 1f3654b..4bd7817 100644
--- a/src/gcal-date-selector.c
+++ b/src/gcal-date-selector.c
@@ -128,9 +128,9 @@ parse_entries (GcalDateSelector *selector)
 
   priv = gcal_date_selector_get_instance_private (selector);
 
-  day = strtol (gtk_entry_get_text (GTK_ENTRY (priv->entries[DAY])), NULL, 0);
-  month = strtol (gtk_entry_get_text (GTK_ENTRY (priv->entries[MONTH])), NULL, 0);
-  year = strtol (gtk_entry_get_text (GTK_ENTRY (priv->entries[YEAR])), NULL, 0);
+  day = atoi (gtk_entry_get_text (GTK_ENTRY (priv->entries[DAY])));
+  month = atoi (gtk_entry_get_text (GTK_ENTRY (priv->entries[MONTH])));
+  year = atoi (gtk_entry_get_text (GTK_ENTRY (priv->entries[YEAR])));
 
   /* Fix year if neccessary */
   if (!priv->have_long_year)


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