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_strlcpy_dynamic_write.c | |
| parent | 1122a7b8d9ab1c6ea030fac11495fc75aae07d42 (diff) | |
Add more dynamic tests
Diffstat (limited to 'tests/test_strlcpy_dynamic_write.c')
| -rw-r--r-- | tests/test_strlcpy_dynamic_write.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_strlcpy_dynamic_write.c b/tests/test_strlcpy_dynamic_write.c new file mode 100644 index 0000000..3a96551 --- /dev/null +++ b/tests/test_strlcpy_dynamic_write.c | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #define _GNU_SOURCE | ||
| 2 | #define _BSD_SOURCE | ||
| 3 | |||
| 4 | #include "common.h" | ||
| 5 | |||
| 6 | #include <string.h> | ||
| 7 | |||
| 8 | int main(int argc, char** argv) { | ||
| 9 | char buffer[8] = {0}; | ||
| 10 | strlcpy(buffer, "1234567", sizeof(buffer)); | ||
| 11 | puts(buffer); | ||
| 12 | |||
| 13 | CHK_FAIL_START | ||
| 14 | strlcpy(buffer, argv[1], argc); | ||
| 15 | CHK_FAIL_END | ||
| 16 | |||
| 17 | puts(buffer); | ||
| 18 | return ret; | ||
| 19 | } | ||
