diff options
| author | jvoisin | 2023-06-22 17:58:58 +0200 |
|---|---|---|
| committer | jvoisin | 2023-06-22 17:58:58 +0200 |
| commit | af7480d0190cb5dcf279a7ddfab320ff084a3471 (patch) | |
| tree | 3ba3190adb08bd5d3a4671358c5ae4c3c13f3ab2 /tests/test_stpcpy_overwrite_under.c | |
| parent | cb1ce9e1815a492de0f13c2b046b8472024b9f6d (diff) | |
Add tests for stpcpy
Diffstat (limited to 'tests/test_stpcpy_overwrite_under.c')
| -rw-r--r-- | tests/test_stpcpy_overwrite_under.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_stpcpy_overwrite_under.c b/tests/test_stpcpy_overwrite_under.c new file mode 100644 index 0000000..2759e5d --- /dev/null +++ b/tests/test_stpcpy_overwrite_under.c | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | char buffer[9] = {'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', '\0'}; | ||
| 7 | puts(buffer); | ||
| 8 | |||
| 9 | CHK_FAIL_START | ||
| 10 | stpcpy(buffer-1, buffer); | ||
| 11 | CHK_FAIL_END | ||
| 12 | |||
| 13 | puts(buffer); | ||
| 14 | return ret; | ||
| 15 | } | ||
