From b1535fe1f90ebacfbf152e5f2704c042a078dde5 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 21 Jul 2023 10:03:44 +0200 Subject: [PATCH] sysfs: fix minor compile warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Seen in Debian QA on mipsel. util-sysfs.c: In function ‘SysFsWriteValue’: util-sysfs.c:50:45: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int64_t’ {aka ‘long long int’} [-Wformat=] 50 | snprintf(sentence, sizeof(sentence), "%ld", value); | ~~^ ~~~~~ | | | | | int64_t {aka long long int} | long int | %lld --- src/util-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util-sysfs.c b/src/util-sysfs.c index 8fd791a460..11f1854a8c 100644 --- a/src/util-sysfs.c +++ b/src/util-sysfs.c @@ -47,7 +47,7 @@ TmEcode SysFsWriteValue(const char *path, int64_t value) SCReturnInt(TM_ECODE_FAILED); } - snprintf(sentence, sizeof(sentence), "%ld", value); + snprintf(sentence, sizeof(sentence), "%" PRIu64, value); ssize_t len = strlen(sentence); if (write(fd, sentence, len) != len) { -- 2.47.2