From 400925d81cc92de52efe6cad6dcc33794262119c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 14 Feb 2006 02:48:22 +0000 Subject: grab a bunch of tests from glibc --- test/string/bug-strncat1.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/string/bug-strncat1.c (limited to 'test/string/bug-strncat1.c') diff --git a/test/string/bug-strncat1.c b/test/string/bug-strncat1.c new file mode 100644 index 000000000..f1b5c37c5 --- /dev/null +++ b/test/string/bug-strncat1.c @@ -0,0 +1,31 @@ +/* Test case by Joseph S. Myers . */ +#undef __USE_STRING_INLINES +#define __USE_STRING_INLINES +#include +#include +#include + +char d[3] = "\0\1\2"; + +int +main (void) +{ + strncat (d, "\5\6", 1); + if (d[0] != '\5') + { + puts ("d[0] != '\\5'"); + exit (1); + } + if (d[1] != '\0') + { + puts ("d[1] != '\\0'"); + exit (1); + } + if (d[2] != '\2') + { + puts ("d[2] != '\\2'"); + exit (1); + } + + return 0; +} -- cgit v1.2.3