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); -->
|
<!-- size_t fread(void *ptr, size_t size, size_t nobj, FILE *stream); -->
|
||||||
<function name="fread,std::fread">
|
<function name="fread,std::fread">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
<use-retval/>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<arg nr="1">
|
<arg nr="1">
|
||||||
<not-null/>
|
<not-null/>
|
||||||
|
|
|
@ -48,12 +48,12 @@ void bufferAccessOutOfBounds(void)
|
||||||
// cppcheck-suppress bufferAccessOutOfBounds
|
// cppcheck-suppress bufferAccessOutOfBounds
|
||||||
// cppcheck-suppress redundantCopy
|
// cppcheck-suppress redundantCopy
|
||||||
strncpy(a,"abcde",6);
|
strncpy(a,"abcde",6);
|
||||||
fread(a,1,5,stdin);
|
(void)fread(a,1,5,stdin);
|
||||||
// cppcheck-suppress bufferAccessOutOfBounds
|
// cppcheck-suppress bufferAccessOutOfBounds
|
||||||
fread(a,1,6,stdin);
|
(void)fread(a,1,6,stdin);
|
||||||
fwrite(a,1,5,stdout);
|
fwrite(a,1,5,stdout);
|
||||||
// cppcheck-suppress bufferAccessOutOfBounds
|
// cppcheck-suppress bufferAccessOutOfBounds
|
||||||
fread(a,1,6,stdout);
|
(void)fread(a,1,6,stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
// memory leak
|
// memory leak
|
||||||
|
|
Loading…
Reference in New Issue