From: Andrea Zagli Date: Wed, 22 Jan 2014 08:17:26 +0000 (+0100) Subject: GtkFormFieldDateTime: validating return value from get_gdatetime_from_str (closes... X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=dc96de7939eeaf15a68dc3e43e1d4937f44f0c5c;p=libgtkform GtkFormFieldDateTime: validating return value from get_gdatetime_from_str (closes #837). --- diff --git a/libgtkform/fielddatetime.c b/libgtkform/fielddatetime.c index 048a501..6bc80fc 100644 --- a/libgtkform/fielddatetime.c +++ b/libgtkform/fielddatetime.c @@ -1000,6 +1000,16 @@ GDateTime hour, minute, seconds); + + if (ret != NULL) + { + /* comparing with original string */ + if (g_strcmp0 (str, g_date_time_format (ret, format)) != 0) + { + g_date_time_unref (ret); + ret = NULL; + } + } } return ret;