mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-28 23:12:17 +01:00
gdbus-example-unix-fd-client: avoid strftime %c specifier
gcc 6 warns (fatally, by default) that %c only uses a 2-digit year
in some locales. The precise format does not seem to be important
for this sample code, so use ISO 8601 instead of suppressing the
warning with a pragma.
Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Colin Walters
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=768453
(cherry picked from commit 037719c27c)
This commit is contained in:
@@ -82,7 +82,7 @@ on_name_appeared (GDBusConnection *connection,
|
||||
now = time (NULL);
|
||||
strftime (now_buf,
|
||||
sizeof now_buf,
|
||||
"%c",
|
||||
"%Y-%m-%d %H:%M:%S",
|
||||
localtime (&now));
|
||||
|
||||
str = g_strdup_printf ("On %s, gdbus-example-unix-fd-client with pid %d was here!\n",
|
||||
|
||||
Reference in New Issue
Block a user