std.cfg: Take the return value from fread() into account.
This commit is contained in:
parent
ae444d7e78
commit
9cb0941df2
|
@ -1058,6 +1058,7 @@
|
|||
<!-- size_t fread(void *ptr, size_t size, size_t nobj, FILE *stream); -->
|
||||
<function name="fread,std::fread">
|
||||
<noreturn>false</noreturn>
|
||||
<use-retval/>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
<not-null/>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue