about summary refs log tree commit diff
path: root/stdlib/tst-strtod2.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-12-11 21:43:56 +0000
committerUlrich Drepper <drepper@redhat.com>2006-12-11 21:43:56 +0000
commit1f55ce483b6f14da23383d7a192a0a9d6b99b7de (patch)
treea789a1908dd3aa2f2f9489cf08340320e1d48b27 /stdlib/tst-strtod2.c
parentf85fb97b9bdd59c6d7b105e81b72b7b69a9647e1 (diff)
downloadglibc-1f55ce483b6f14da23383d7a192a0a9d6b99b7de.tar.gz
glibc-1f55ce483b6f14da23383d7a192a0a9d6b99b7de.tar.xz
glibc-1f55ce483b6f14da23383d7a192a0a9d6b99b7de.zip
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Parse thousand
	separators also if no non-zero digits found.
	* stdlib/Makefile (tests): Add tst-strtod3.
Diffstat (limited to 'stdlib/tst-strtod2.c')
-rw-r--r--stdlib/tst-strtod2.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/stdlib/tst-strtod2.c b/stdlib/tst-strtod2.c
new file mode 100644
index 0000000000..925ea9cafa
--- /dev/null
+++ b/stdlib/tst-strtod2.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+static int
+do_test (void)
+{
+  int status = 0;
+  const char s[] = "0x";
+  char *ep;
+  double r = strtod (s, &ep);
+  if (r != 0)
+    {
+      printf ("r = %g, expect 0\n", r);
+      status = 1;
+    }
+  if (ep != s + 1)
+    {
+      printf ("strtod parsed %ju characters, expected 1\n", ep - s);
+      status = 1;
+    }
+  return status;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"