mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-14 08:16:24 +01:00
gdatetime: add missing g_return_() check in g_date_time_format_iso8601
A clear warning is better than a NULL pointer dereference. Signed-off-by: Aleksander Morgado <aleksandermj@chromium.org>
This commit is contained in:
parent
f5a51089d8
commit
737ca7de91
@ -3497,6 +3497,8 @@ g_date_time_format_iso8601 (GDateTime *datetime)
|
|||||||
gint64 offset;
|
gint64 offset;
|
||||||
gchar *format = "%C%y-%m-%dT%H:%M:%S";
|
gchar *format = "%C%y-%m-%dT%H:%M:%S";
|
||||||
|
|
||||||
|
g_return_val_if_fail (datetime != NULL, NULL);
|
||||||
|
|
||||||
/* if datetime has sub-second non-zero values below the second precision we
|
/* if datetime has sub-second non-zero values below the second precision we
|
||||||
* should print them as well */
|
* should print them as well */
|
||||||
if (datetime->usec % G_TIME_SPAN_SECOND != 0)
|
if (datetime->usec % G_TIME_SPAN_SECOND != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user