Test for handling side effects in first argument of strpbrk.
authordrepper <drepper>
Mon, 30 Oct 2000 04:06:53 +0000 (04:06 +0000)
committerdrepper <drepper>
Mon, 30 Oct 2000 04:06:53 +0000 (04:06 +0000)
string/bug-strpbrk1.c [new file with mode: 0644]

diff --git a/string/bug-strpbrk1.c b/string/bug-strpbrk1.c
new file mode 100644 (file)
index 0000000..7d5eef8
--- /dev/null
@@ -0,0 +1,18 @@
+/* Test case by Joseph S. Myers <jsm28@cam.ac.uk>.  */
+#define __USE_STRING_INLINES
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+int
+main (void)
+{
+  const char *a = "abc";
+  const char *b = a;
+
+  strpbrk (b++, "");
+  if (b != a + 1)
+    exit (1);
+
+  exit (0);
+}