From 4de756766cf32168c735fa13b20d6edb0fef0733 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 19 Jun 2018 13:13:24 +1000 Subject: [PATCH] test: remove a compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Leftover from a previous iteration of this code - having a static but unnecessarily large size for dirname results in: ../test/litest.c:1251:38: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] snprintf(dest, sizeof(dest), "%s/%s", dirname, filename); ^ ../test/litest.c:1251:3: note: ‘snprintf’ output 2 or more bytes (assuming 4097) into a destination of size 4096 snprintf(dest, sizeof(dest), "%s/%s", dirname, filename); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Peter Hutterer --- test/litest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/litest.c b/test/litest.c index caf2c8c8..23a9cde7 100644 --- a/test/litest.c +++ b/test/litest.c @@ -1229,7 +1229,7 @@ litest_install_quirks(struct list *created_files_list) { struct litest_test_device **dev = devices; struct created_file *file; - char dirname[PATH_MAX] = "/run/litest-XXXXXX"; + char dirname[] = "/run/litest-XXXXXX"; char **quirks, **q; litest_assert_notnull(mkdtemp(dirname));