Merge pull request #1015 from versat/test_std_strncpy

Add missing tests for strncpy
This commit is contained in:
orbitcowboy 2017-12-11 11:17:32 +01:00 committed by GitHub
commit f31311b249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -48,6 +48,11 @@ void bufferAccessOutOfBounds(void)
// cppcheck-suppress bufferAccessOutOfBounds
// cppcheck-suppress redundantCopy
strncpy(a,"abcde",6);
// cppcheck-suppress bufferAccessOutOfBounds
// cppcheck-suppress redundantCopy
strncpy(a,"a",6);
// cppcheck-suppress redundantCopy
strncpy(a,"abcdefgh",4);
fread(a,1,5,stdin);
// cppcheck-suppress bufferAccessOutOfBounds
fread(a,1,6,stdin);