std.cfg: Added more test for strncat().

This commit is contained in:
orbitcowboy 2022-04-21 16:43:52 +02:00
parent a6f87e6b8a
commit 7f48127c0b
2 changed files with 20 additions and 0 deletions

View File

@ -3449,6 +3449,16 @@ void uninitvar_strncat(char *d, char *s, size_t n)
(void)strncat(d,s,n);
}
void nullPointer_strncat(char *d, char *s, size_t n)
{
// cppcheck-suppress nullPointer
(void)strncat(NULL,s,n);
// cppcheck-suppress nullPointer
(void)strncat(d,NULL,n);
// no warning is expected for
(void)strncat(d,s,n);
}
// errno_t strcat_s(char *restrict dest, rsize_t destsz, const char *restrict src); // since C11
void uninitvar_strcat_s(char *Ct, size_t N, char *S)
{

View File

@ -1283,6 +1283,16 @@ void nullPointer_wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n)
(void)std::wmemcmp(s1,s2,n);
}
void nullPointer_strncat(char *d, char *s, size_t n)
{
// cppcheck-suppress nullPointer
(void)std::strncat(NULL,s,n);
// cppcheck-suppress nullPointer
(void)std::strncat(d,NULL,n);
// no warning is expected for
(void)std::strncat(d,s,n);
}
void nullPointer_strncmp(const char *s1, const char *s2, size_t n)
{
// cppcheck-suppress nullPointer