From d7c8c46c101a9b6ce9da9e5e370fccee14e511cb Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 25 May 2018 08:36:47 +0200 Subject: [PATCH] test std.cfg: Improved testing for strcat() and wcscat(). --- cfg/windows.cfg | 2 +- test/cfg/std.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/cfg/windows.cfg b/cfg/windows.cfg index 0a03cb1ba..8095ac734 100644 --- a/cfg/windows.cfg +++ b/cfg/windows.cfg @@ -5389,7 +5389,7 @@ HFONT CreateFont( - + diff --git a/test/cfg/std.c b/test/cfg/std.c index 4b5dc62c1..b042e4d17 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -2840,20 +2840,34 @@ void uninitvar_setvbuf(void) (void)setvbuf(stream,buf,mode,size); } -void uninitvar_strcat(void) +void uninitvar_strcat(char *dest, const char * const source) { char *deststr; char *srcstr; // cppcheck-suppress uninitvar (void)strcat(deststr,srcstr); + // cppcheck-suppress uninitvar + (void)strcat(dest,srcstr); + // cppcheck-suppress uninitvar + (void)strcat(deststr,source); + + // no warning shall be shown for + (void)strcat(dest,source); } -void uninitvar_wcscat(void) +void uninitvar_wcscat(wchar_t *dest, const wchar_t * const source) { wchar_t *deststr; wchar_t *srcstr; // cppcheck-suppress uninitvar (void)wcscat(deststr,srcstr); + // cppcheck-suppress uninitvar + (void)wcscat(dest,srcstr); + // cppcheck-suppress uninitvar + (void)wcscat(deststr,source); + + // no warning shall be shown for + (void)wcscat(dest,source); } void uninitvar_wcrtomb(void)