[glib/glib-2-48] gdbus-example-unix-fd-client: avoid strftime %c specifier
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-48] gdbus-example-unix-fd-client: avoid strftime %c specifier
- Date: Mon, 15 Aug 2016 13:06:07 +0000 (UTC)
commit cd7562b8d94d4929273910827f49cde049b449ab
Author: Simon McVittie <smcv debian org>
Date: Sun Aug 14 15:36:17 2016 +0100
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 037719c27c541e5e529c7f0dc8a14792a26303c9)
gio/tests/gdbus-example-unix-fd-client.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/tests/gdbus-example-unix-fd-client.c b/gio/tests/gdbus-example-unix-fd-client.c
index e3ab015..cf1330f 100644
--- a/gio/tests/gdbus-example-unix-fd-client.c
+++ b/gio/tests/gdbus-example-unix-fd-client.c
@@ -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",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]