fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

commit d2ab22e80e192f6013f7fa83a6b28864bd5865e4
parent 62c26587315cddaeee6708d71f1bd892e24817ee
Author: jvoisin <julien.voisin@dustri.org>
Date:   Sun, 17 Sep 2023 19:04:27 +0200

Make use of the buffers in the wide-chars tests

Just in case the compiler tries to optimize some things away.

Diffstat:
Mtests/test_wcscat_static_write.c | 2++
Mtests/test_wcscpy_static_write.c | 2++
Mtests/test_wcsncat_static_write.c | 2++
Mtests/test_wcsncpy_static_write.c | 2++
Mtests/test_wmemcpy_dynamic_write.c | 2++
Mtests/test_wmemcpy_static_write.c | 2++
Mtests/test_wmemmove_dynamic_write.c | 2++
Mtests/test_wmemmove_static_write.c | 2++
Mtests/test_wmemset_dynamic.c | 2++
Mtests/test_wmemset_static.c | 2++
10 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/tests/test_wcscat_static_write.c b/tests/test_wcscat_static_write.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[8] = {0}; wcscat(buffer, L"α"); + fputws(buffer, stdout); CHK_FAIL_START wcscat(buffer, L"αβγδεζηθικλμνξοπρστυφχψω"); CHK_FAIL_END + fputws(buffer, stdout); return ret; } diff --git a/tests/test_wcscpy_static_write.c b/tests/test_wcscpy_static_write.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[8] = {0}; wcscpy(buffer, L"α"); + fputws(buffer, stdout); CHK_FAIL_START wcscpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω"); CHK_FAIL_END + fputws(buffer, stdout); return ret; } diff --git a/tests/test_wcsncat_static_write.c b/tests/test_wcsncat_static_write.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[8] = {0}; wcsncat(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2); + fputws(buffer, stdout); CHK_FAIL_START wcsncat(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1337); CHK_FAIL_END + fputws(buffer, stdout); return ret; } diff --git a/tests/test_wcsncpy_static_write.c b/tests/test_wcsncpy_static_write.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[8] = {0}; wcsncpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1); + fputws(buffer, stdout); CHK_FAIL_START wcsncpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1337); CHK_FAIL_END + fputws(buffer, stdout); return ret; } diff --git a/tests/test_wmemcpy_dynamic_write.c b/tests/test_wmemcpy_dynamic_write.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[2] = {0}; wmemcpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2); + fputws(buffer, stdout); CHK_FAIL_START wmemcpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", argc); CHK_FAIL_END + fputws(buffer, stdout); return ret; } diff --git a/tests/test_wmemcpy_static_write.c b/tests/test_wmemcpy_static_write.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[2] = {0}; wmemcpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2); + fputws(buffer, stdout); CHK_FAIL_START wmemcpy(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1337); CHK_FAIL_END + fputws(buffer, stdout); return ret; } diff --git a/tests/test_wmemmove_dynamic_write.c b/tests/test_wmemmove_dynamic_write.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[2] = {0}; wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2); + fputws(buffer, stdout); CHK_FAIL_START wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", argc); CHK_FAIL_END + fputws(buffer, stdout); return ret; } diff --git a/tests/test_wmemmove_static_write.c b/tests/test_wmemmove_static_write.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[2] = {0}; wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 2); + fputws(buffer, stdout); CHK_FAIL_START wmemmove(buffer, L"αβγδεζηθικλμνξοπρστυφχψω", 1337); CHK_FAIL_END + fputws(buffer, stdout); return ret; } diff --git a/tests/test_wmemset_dynamic.c b/tests/test_wmemset_dynamic.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[4] = {0}; wmemset(buffer, L'A', 3); + fputws(buffer, stdout); CHK_FAIL_START wmemset(buffer, L'B', argc); CHK_FAIL_END + fputws(buffer, stdout); return ret; } diff --git a/tests/test_wmemset_static.c b/tests/test_wmemset_static.c @@ -5,10 +5,12 @@ int main(int argc, char** argv) { wchar_t buffer[4] = {0}; wmemset(buffer, L'A', 3); + fputws(buffer, stdout); CHK_FAIL_START wmemset(buffer, L'B', 16); CHK_FAIL_END + fputws(buffer, stdout); return ret; }