fortify-headers

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

commit c17d47669ff12057f732f9ae3f69b22d52b4c6b5
parent 70bbb621b5bad33b03053264abc6deb0c6c5525e
Author: jvoisin <julien.voisin@dustri.org>
Date:   Sun, 20 Aug 2023 19:33:35 +0200

Fix some sizeof-related typoes in the testsuite

Diffstat:
Mtests/test_fread_overwrite_dynamic.c | 2+-
Mtests/test_fread_overwrite_static.c | 2+-
Mtests/test_fwrite_overwrite_dynamic.c | 2+-
Mtests/test_fwrite_overwrite_static.c | 2+-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/test_fread_overwrite_dynamic.c b/tests/test_fread_overwrite_dynamic.c @@ -7,7 +7,7 @@ int main(int argc, char** argv) { char buffer[12] = {0}; - assert(sizeof(buffer - 2) * argc > sizeof(buffer)); + assert((sizeof(buffer) - 2) * argc > sizeof(*buffer)); CHK_FAIL_START fread(buffer, sizeof(buffer) - 2, argc, NULL); diff --git a/tests/test_fread_overwrite_static.c b/tests/test_fread_overwrite_static.c @@ -7,7 +7,7 @@ int main(int argc, char** argv) { char buffer[12] = {0}; - assert(sizeof(buffer - 2) * 10 > sizeof(buffer)); + assert((sizeof(buffer) - 2) * 10 > sizeof(buffer)); CHK_FAIL_START fread(buffer, sizeof(buffer) - 2, 10, NULL); diff --git a/tests/test_fwrite_overwrite_dynamic.c b/tests/test_fwrite_overwrite_dynamic.c @@ -7,7 +7,7 @@ int main(int argc, char** argv) { char buffer[12] = {0}; - assert(sizeof(buffer - 2) * argc > sizeof(buffer)); + assert((sizeof(buffer) - 2) * argc > sizeof(buffer)); CHK_FAIL_START fwrite(buffer, sizeof(buffer) - 2, argc, NULL); diff --git a/tests/test_fwrite_overwrite_static.c b/tests/test_fwrite_overwrite_static.c @@ -7,7 +7,7 @@ int main(int argc, char** argv) { char buffer[12] = {0}; - assert(sizeof(buffer - 2) * 10 > sizeof(buffer)); + assert((sizeof(buffer) - 2) * 10 > sizeof(buffer)); CHK_FAIL_START fwrite(buffer, sizeof(buffer) - 2, 10, NULL);