diff options
| author | jvoisin | 2024-04-24 18:36:10 +0200 |
|---|---|---|
| committer | jvoisin | 2024-04-24 18:40:13 +0200 |
| commit | 3375426d8c18f43f58ab83c261735b04562828ae (patch) | |
| tree | ca3b3179238bdeadf26f988e26666f7ebca29cfc /tests | |
| parent | a817e1555a755224cacc1cbdeeaefb6a1de606f0 (diff) | |
Add a test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Makefile | 1 | ||||
| -rw-r--r-- | tests/test_issue57_strcpy.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile index 81a1943..c18898e 100644 --- a/tests/Makefile +++ b/tests/Makefile | |||
| @@ -43,6 +43,7 @@ RUNTIME_TARGETS= \ | |||
| 43 | test_getlogin_r_dynamic \ | 43 | test_getlogin_r_dynamic \ |
| 44 | test_getlogin_r_static \ | 44 | test_getlogin_r_static \ |
| 45 | test_issue57 \ | 45 | test_issue57 \ |
| 46 | test_issue57_strcpy \ | ||
| 46 | test_mbsrtowcs_dynamic \ | 47 | test_mbsrtowcs_dynamic \ |
| 47 | test_mbsrtowcs_static \ | 48 | test_mbsrtowcs_static \ |
| 48 | test_mbstowcs_dynamic \ | 49 | test_mbstowcs_dynamic \ |
diff --git a/tests/test_issue57_strcpy.c b/tests/test_issue57_strcpy.c new file mode 100644 index 0000000..24f8ab1 --- /dev/null +++ b/tests/test_issue57_strcpy.c | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | char buffer[32] ={'a', 'b', 'c', 0}; | ||
| 7 | strcpy(buffer , buffer + 16); | ||
| 8 | puts(buffer); | ||
| 9 | |||
| 10 | return ret; | ||
| 11 | } | ||
