From 9cb0941df28e008bde5af080f42867341f9c4c68 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Thu, 2 Feb 2017 13:33:06 +0100 Subject: [PATCH] std.cfg: Take the return value from fread() into account. --- cfg/std.cfg | 1 + test/cfg/std.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cfg/std.cfg b/cfg/std.cfg index fad093880..2ebd2c42d 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -1058,6 +1058,7 @@ false + diff --git a/test/cfg/std.c b/test/cfg/std.c index 0fea8bef0..032b51f52 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -48,12 +48,12 @@ void bufferAccessOutOfBounds(void) // cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress redundantCopy strncpy(a,"abcde",6); - fread(a,1,5,stdin); + (void)fread(a,1,5,stdin); // cppcheck-suppress bufferAccessOutOfBounds - fread(a,1,6,stdin); + (void)fread(a,1,6,stdin); fwrite(a,1,5,stdout); // cppcheck-suppress bufferAccessOutOfBounds - fread(a,1,6,stdout); + (void)fread(a,1,6,stdout); } // memory leak