std.cfg: Added more test for strncpy().
This commit is contained in:
parent
7f48127c0b
commit
e683f3ce28
|
@ -3459,6 +3459,16 @@ void nullPointer_strncat(char *d, char *s, size_t n)
|
|||
(void)strncat(d,s,n);
|
||||
}
|
||||
|
||||
void nullPointer_strncpy(char *d, const char *s, size_t n)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)strncpy(NULL,s,n);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)strncpy(d,NULL,n);
|
||||
// no warning is expected for
|
||||
(void)strncpy(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)
|
||||
{
|
||||
|
|
|
@ -1293,6 +1293,16 @@ void nullPointer_strncat(char *d, char *s, size_t n)
|
|||
(void)std::strncat(d,s,n);
|
||||
}
|
||||
|
||||
void nullPointer_strncpy(char *d, const char *s, size_t n)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)std::strncpy(NULL,s,n);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void)std::strncpy(d,NULL,n);
|
||||
// no warning is expected for
|
||||
(void)std::strncpy(d,s,n);
|
||||
}
|
||||
|
||||
void nullPointer_strncmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
|
|
Loading…
Reference in New Issue