std.cfg: Improved tests for setbuf().

This commit is contained in:
orbitcowboy 2022-04-27 09:21:09 +02:00
parent fa351e010b
commit 561e21e2aa
1 changed files with 10 additions and 2 deletions

View File

@ -3112,12 +3112,20 @@ void uninitvar_vwscanf(void)
(void)vwscanf(format,arg); (void)vwscanf(format,arg);
} }
void nullPointer_setbuf(FILE *stream, char *buf)
{
// cppcheck-suppress nullPointer
setbuf(NULL,buf);
setbuf(stream,NULL);
setbuf(stream,buf);
}
void uninitvar_setbuf(void) void uninitvar_setbuf(void)
{ {
FILE *stream; FILE *stream;
char *buf; char *buf;
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
(void)setbuf(stream,buf); setbuf(stream,buf);
} }
void uninitvar_setvbuf(void) void uninitvar_setvbuf(void)
@ -3402,7 +3410,7 @@ void uninitvar_wcscpy(wchar_t *d, wchar_t*s)
size_t bufferAccessOutOfBounds_strftime(char *s, size_t max, const char *fmt, const struct tm *p) size_t bufferAccessOutOfBounds_strftime(char *s, size_t max, const char *fmt, const struct tm *p)
{ {
char buf[42] = {0}; char buf[42] = {0};
// cppcheck-suppress bufferAccessOutOfBounds // cppcheck-suppress bufferAccessOutOfBounds
(void) strftime(buf,43,fmt,p); (void) strftime(buf,43,fmt,p);
(void) strftime(buf,max,fmt,p); (void) strftime(buf,max,fmt,p);