diff options
Diffstat (limited to 'tests/test_snprintf_static.c')
| -rw-r--r-- | tests/test_snprintf_static.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_snprintf_static.c b/tests/test_snprintf_static.c new file mode 100644 index 0000000..d3df447 --- /dev/null +++ b/tests/test_snprintf_static.c | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <stdio.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | #if !defined(__clang__) | ||
| 7 | char buffer[8] = {0}; | ||
| 8 | snprintf(buffer, sizeof(buffer), "%s", "1234567"); | ||
| 9 | puts(buffer); | ||
| 10 | |||
| 11 | CHK_FAIL_START | ||
| 12 | snprintf(buffer, sizeof(buffer) + 4, "%s", "1234567890"); | ||
| 13 | CHK_FAIL_END | ||
| 14 | |||
| 15 | puts(buffer); | ||
| 16 | #endif | ||
| 17 | return ret; | ||
| 18 | } | ||
