diff options
| author | Sertonix | 2025-10-11 18:25:20 +0200 |
|---|---|---|
| committer | Julien Voisin | 2025-10-12 14:47:11 +0200 |
| commit | 41d3081c4ac0a79a4ad292957ead84f8477eaa55 (patch) | |
| tree | e1c2c2e51beb8009c61789bd6239e083e8288805 /tests/test_swab_dynamic_write.c | |
| parent | 2e22fe52b441308c274cfec4436204a9e5f70db7 (diff) | |
Add `swab`
Make the overlap check pedantic only since some software seems to rely
on glibc working when src and dest are the same.
Diffstat (limited to 'tests/test_swab_dynamic_write.c')
| -rw-r--r-- | tests/test_swab_dynamic_write.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_swab_dynamic_write.c b/tests/test_swab_dynamic_write.c new file mode 100644 index 0000000..21725b7 --- /dev/null +++ b/tests/test_swab_dynamic_write.c | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #define _XOPEN_SOURCE | ||
| 2 | |||
| 3 | #include "common.h" | ||
| 4 | |||
| 5 | #include <unistd.h> | ||
| 6 | |||
| 7 | int main(int argc, char** argv) { | ||
| 8 | char buffer[8] = {0}; | ||
| 9 | swab("1234567890", buffer, sizeof(buffer) - 1); | ||
| 10 | puts(buffer); | ||
| 11 | |||
| 12 | CHK_FAIL_START | ||
| 13 | swab("1234567890", buffer, argc); | ||
| 14 | CHK_FAIL_END | ||
| 15 | |||
| 16 | puts(buffer); | ||
| 17 | return ret; | ||
| 18 | } | ||
