std.cfg: Improved configuration of std::filebuf::open().

This commit is contained in:
orbitcowboy 2022-05-10 10:17:27 +02:00
parent 1382cd837e
commit 6152e5712a
2 changed files with 9 additions and 0 deletions

View File

@ -7216,6 +7216,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
<use-retval/> <use-retval/>
<returnValue type="std::filebuf *"/> <returnValue type="std::filebuf *"/>
<arg nr="1" direction="in"> <arg nr="1" direction="in">
<not-null/>
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="2" direction="in"> <arg nr="2" direction="in">

View File

@ -87,6 +87,14 @@ void uninitvar_std_ofstream_open(std::ofstream &os, const std::string &strFileNa
os.open(ptr); os.open(ptr);
} }
void nullPointer_std_filebuf_open(std::filebuf &fb, const std::string &strFileName, const char* filename, std::ios_base::openmode mode)
{
// cppcheck-suppress nullPointer
(void)fb.open(nullptr, mode);
(void)fb.open(filename, mode);
(void)fb.open(strFileName, mode);
}
void nullPointer_std_ofstream_open(std::ofstream &os, const std::string &strFileName, const char* filename, std::ios_base::openmode mode) void nullPointer_std_ofstream_open(std::ofstream &os, const std::string &strFileName, const char* filename, std::ios_base::openmode mode)
{ {
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer