From: Victor Julien Date: Fri, 21 Jul 2023 08:03:44 +0000 (+0200) Subject: sysfs: fix minor compile warning X-Git-Tag: suricata-7.0.1~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1535fe1f90ebacfbf152e5f2704c042a078dde5;p=thirdparty%2Fsuricata.git sysfs: fix minor compile warning 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 --- 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) {