From d2e7edcd0048a5040c8e30f49572907aff98f311 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 11 Dec 2023 17:53:28 +0100 Subject: [PATCH] lib: avoid format truncation commonio.c: In function 'commonio_unlock': commonio.c:487:49: warning: '.lock' directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] 487 | snprintf (lock, sizeof lock, "%s.lock", db->filename); | ^~~~~ commonio.c:487:17: note: 'snprintf' output between 6 and 1029 bytes into a destination of size 1024 487 | snprintf (lock, sizeof lock, "%s.lock", db->filename); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- lib/commonio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commonio.c b/lib/commonio.c index b3106103f..9afe5de01 100644 --- a/lib/commonio.c +++ b/lib/commonio.c @@ -467,7 +467,7 @@ static void dec_lock_count (void) int commonio_unlock (struct commonio_db *db) { - char lock[1024]; + char lock[1029]; if (db->isopen) { db->readonly = true; -- 2.47.2