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
This commit is contained in:
Simon McVittie 2016-08-14 15:36:17 +01:00
parent 634990a374
commit 037719c27c

View File

@ -82,7 +82,7 @@ on_name_appeared (GDBusConnection *connection,
now = time (NULL); now = time (NULL);
strftime (now_buf, strftime (now_buf,
sizeof now_buf, sizeof now_buf,
"%c", "%Y-%m-%d %H:%M:%S",
localtime (&now)); localtime (&now));
str = g_strdup_printf ("On %s, gdbus-example-unix-fd-client with pid %d was here!\n", str = g_strdup_printf ("On %s, gdbus-example-unix-fd-client with pid %d was here!\n",