[evolution-data-server/gnome-3-26] Mute a compiler warning from e_collator_generate_key()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-26] Mute a compiler warning from e_collator_generate_key()
- Date: Thu, 5 Oct 2017 11:40:02 +0000 (UTC)
commit a09fdfd993691cb4046d040b17bb1b70c551807e
Author: Milan Crha <mcrha redhat com>
Date: Thu Oct 5 13:38:39 2017 +0200
Mute a compiler warning from e_collator_generate_key()
Nothing great, just give it large enough buffer. The warning in question was:
In function ‘e_collator_generate_key’:
src/libedataserver/e-collator.c:524:37: warning: ‘snprintf’ output truncated before the last format
character [-Wformat-truncation=]
snprintf (collation_key, 4, "%03d-", alphabet_index);
^
src/libedataserver/e-collator.c:524:3: note: ‘snprintf’ output between 5 and 13 bytes into a destination
of size 4
snprintf (collation_key, 4, "%03d-", alphabet_index);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libedataserver/e-collator.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/libedataserver/e-collator.c b/src/libedataserver/e-collator.c
index d7c8f69..334b8f1 100644
--- a/src/libedataserver/e-collator.c
+++ b/src/libedataserver/e-collator.c
@@ -521,7 +521,7 @@ e_collator_generate_key (ECollator *collator,
collation_key = g_malloc (key_len + 5);
/* Format the alphabetic index into the first 4 chars */
- snprintf (collation_key, 4, "%03d-", alphabet_index);
+ snprintf (collation_key, key_len, "%03d-", alphabet_index);
/* Get the sort key and put it in &collation_key[4] */
ucol_getSortKey (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]