diff options
Diffstat (limited to 'test-strndup.c')
-rw-r--r-- | test-strndup.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test-strndup.c b/test-strndup.c new file mode 100644 index 00000000..82e4e547 --- /dev/null +++ b/test-strndup.c @@ -0,0 +1,10 @@ +#include <string.h> + +int +main(void) +{ + char *s; + + s = strndup("123", 2); + return s[0] != '1' ? 1 : s[1] != '2' ? 2 : s[2] != '\0' ? 3 : 0; +} |