diff options
| author | jvoisin | 2023-09-17 16:02:08 +0200 |
|---|---|---|
| committer | jvoisin | 2023-09-17 16:02:08 +0200 |
| commit | 267d5dbe4f79b8ebff8588700b2a8c0d1e56fc97 (patch) | |
| tree | 0932aa51a0842ed3393e1d5610c285fd47a07300 /tests/test_strncpy_dynamic_write.c | |
| parent | 1122a7b8d9ab1c6ea030fac11495fc75aae07d42 (diff) | |
Add more dynamic tests
Diffstat (limited to 'tests/test_strncpy_dynamic_write.c')
| -rw-r--r-- | tests/test_strncpy_dynamic_write.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_strncpy_dynamic_write.c b/tests/test_strncpy_dynamic_write.c new file mode 100644 index 0000000..6af18a7 --- /dev/null +++ b/tests/test_strncpy_dynamic_write.c | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | char buffer[8] = {0}; | ||
| 7 | strncpy(buffer, "1234567", 5); | ||
| 8 | puts(buffer); | ||
| 9 | |||
| 10 | CHK_FAIL_START | ||
| 11 | strncpy(buffer, argv[1], argc); | ||
| 12 | CHK_FAIL_END | ||
| 13 | |||
| 14 | puts(buffer); | ||
| 15 | return ret; | ||
| 16 | } | ||
