new test system
[libc-test] / src / regression / wcsncpy-read-overflow.c
diff --git a/src/regression/wcsncpy-read-overflow.c b/src/regression/wcsncpy-read-overflow.c
new file mode 100644 (file)
index 0000000..05c943d
--- /dev/null
@@ -0,0 +1,14 @@
+// commit: e98136207ad1a6df1cdc1578e4ad56f8f0db4047 2011-05-22
+#include <wchar.h>
+#include "test.h"
+
+int main(void)
+{
+       wchar_t dst[] = { 'a', 'a' };
+       wchar_t src[] = { 0, 'b' };
+
+       wcsncpy(dst, src, 1);
+       if(dst[1] != 'a')
+               t_error("wcsncpy copied more than N\n");
+       return t_status;
+}