summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-03 13:59:19 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-03 13:59:19 -0700
commit4f7cef0b64f3baf5b07f1b906d646c2ad35812e3 (patch)
tree4fdbaddf30cc3dcdcf8e901866b86c88c4b624bd
parent931ad744c4235157c48f1008c4880dc598eaeb13 (diff)
Fix a -Wformat-truncation warning
xclipboard.c: In function ‘set_button_state’: xclipboard.c:196:52: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] snprintf (labelString, sizeof(labelString), "%d", IndexCurrentClip ()); ^ xclipboard.c:196:5: note: ‘snprintf’ output between 2 and 11 bytes into a destination of size 10 snprintf (labelString, sizeof(labelString), "%d", IndexCurrentClip ()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xclipboard.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xclipboard.c b/xclipboard.c
index d8d1e2a..348d0a6 100644
--- a/xclipboard.c
+++ b/xclipboard.c
@@ -185,7 +185,7 @@ set_button_state (void)
{
Boolean prevvalid, nextvalid;
Arg arg;
- char labelString[10];
+ char labelString[12];
prevvalid = currentClip->prev != NULL;
nextvalid = currentClip->next != NULL;