std.cfg: Ensure a warning is issued for null pointer input for strlen().

This commit is contained in:
orbitcowboy 2022-04-21 09:09:46 +02:00
parent 3bd65d42cd
commit 49057543a1
1 changed files with 7 additions and 0 deletions

View File

@ -381,6 +381,13 @@ void nullpointer(int value)
wscanf(L"%i", NULL);
}
size_t nullPointer_strlen(const char *s)
{
// cppcheck-suppress nullPointer
(void) strlen(NULL);
return strlen(s);
}
void nullpointerMemchr1(char *p, char *s)
{
p = memchr(s, 'p', strlen(s));