summaryrefslogtreecommitdiff
path: root/tests/test_fwrite_overwrite_dynamic.c
diff options
context:
space:
mode:
authorjvoisin2023-07-11 00:14:13 +0200
committerjvoisin2023-07-11 00:18:32 +0200
commit8b6129312db7b2405f883c4080b835c69a855627 (patch)
tree3fae0f94c33537db91c4c8488e78f467371f12b0 /tests/test_fwrite_overwrite_dynamic.c
parent759cb4697e9bba06a5aabad9899d0700f57051da (diff)
Add more dynamic tests
Diffstat (limited to 'tests/test_fwrite_overwrite_dynamic.c')
-rw-r--r--tests/test_fwrite_overwrite_dynamic.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_fwrite_overwrite_dynamic.c b/tests/test_fwrite_overwrite_dynamic.c
new file mode 100644
index 0000000..e5545f3
--- /dev/null
+++ b/tests/test_fwrite_overwrite_dynamic.c
@@ -0,0 +1,18 @@
1#include <assert.h>
2
3#include "common.h"
4
5#include <stdio.h>
6
7int main(int argc, char** argv) {
8 char buffer[12] = {0};
9
10 assert(sizeof(buffer - 2) * argc > sizeof(buffer));
11
12 CHK_FAIL_START
13 fwrite(buffer, sizeof(buffer) - 2, argc, NULL);
14 CHK_FAIL_END
15
16 puts(buffer);
17 return ret;
18}