From f1bc94bd328286225ad9fcff21882cb39c7ea4b4 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 13 Nov 2020 14:48:05 +0900 Subject: [PATCH] fs/procfs/fs_procfscpuload.c: Fix printf format warnings --- fs/procfs/fs_procfscpuload.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/procfs/fs_procfscpuload.c b/fs/procfs/fs_procfscpuload.c index da13d72e6f..ee6970441e 100644 --- a/fs/procfs/fs_procfscpuload.c +++ b/fs/procfs/fs_procfscpuload.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -252,7 +253,8 @@ static ssize_t cpuload_read(FAR struct file *filep, FAR char *buffer, fracpart = 0; } - linesize = snprintf(attr->line, CPULOAD_LINELEN, "%3d.%01d%%\n", + linesize = snprintf(attr->line, CPULOAD_LINELEN, + "%3" PRId32 ".%01" PRId32 "%%\n", intpart, fracpart); /* Save the linesize in case we are re-entered with f_pos > 0 */