posix.cfg: Improved tests for readlink().

This commit is contained in:
orbitcowboy 2022-05-01 14:17:49 +02:00
parent 0e4a17e2ab
commit cbcbff7d12
1 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,15 @@
#include <wchar.h> #include <wchar.h>
#include <string.h> #include <string.h>
ssize_t nullPointer_readlink(const char *path, char *buf, size_t bufsiz)
{
// cppcheck-suppress nullPointer
(void)readlink(NULL, buf, bufsiz);
// cppcheck-suppress nullPointer
(void)readlink(path, NULL, bufsiz);
return readlink(path, buf, bufsiz);
}
int nullPointer_readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz) int nullPointer_readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz)
{ {
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer