From 53c53db312ab1f88e37b2527b066d04ca08d8079 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Mon, 28 May 2018 21:52:44 +0200 Subject: [PATCH] windows.cfg: Added support for _mbscat_s(). --- cfg/windows.cfg | 20 ++++++++++++++++++++ test/cfg/windows.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/cfg/windows.cfg b/cfg/windows.cfg index 5e5e41ba4..38beaa743 100644 --- a/cfg/windows.cfg +++ b/cfg/windows.cfg @@ -5308,6 +5308,26 @@ HFONT CreateFont( + + + + false + + + + + + + + + + 0: + + + + + + false diff --git a/test/cfg/windows.cpp b/test/cfg/windows.cpp index 57df97827..2d5b610ab 100644 --- a/test/cfg/windows.cpp +++ b/test/cfg/windows.cpp @@ -793,3 +793,33 @@ unsigned char * nullPointer_mbscat(unsigned char *strDestination, const unsigned // no warning shall be shown for return _mbscat(strDestination,strSource); } + +// errno_t _mbscat_s(unsigned char *strDestination, size_t numberOfElements, const unsigned char *strSource ); +error_t uninitvar_mbscat_s(unsigned char *strDestination, size_t numberOfElements, const unsigned char *strSource) +{ + unsigned char *uninit_strDestination; + size_t uninit_numberOfElements; + unsigned char *uninit_strSource; + + // cppcheck-suppress uninitvar + (void)_mbscat_s(uninit_strDestination, numberOfElements, strSource); + // cppcheck-suppress uninitvar + (void)_mbscat_s(strDestination, uninit_numberOfElements, strSource); + // cppcheck-suppress uninitvar + (void)_mbscat_s(strDestination, numberOfElements, uninit_strSource); + + // no warning shall be shown for + return _mbscat_s(strDestination, numberOfElements, strSource); +} + +// errno_t _mbscat_s(unsigned char *strDestination, size_t numberOfElements, const unsigned char *strSource ); +error_t nullPointer_mbscat_s(unsigned char *strDestination, size_t numberOfElements, const unsigned char *strSource) +{ + // cppcheck-suppress nullPointer + (void)_mbscat_s(0, numberOfElements, strSource); + // cppcheck-suppress nullPointer + (void)_mbscat_s(strDestination, numberOfElements, 0); + + // no warning shall be shown for + return _mbscat_s(strDestination, numberOfElements, strSource); +}