about summary refs log tree commit diff
path: root/stdlib/tst-atof1.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-atof1.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-atof1.c')
-rw-r--r--stdlib/tst-atof1.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/stdlib/tst-atof1.c b/stdlib/tst-atof1.c
new file mode 100644
index 0000000000..879d866558
--- /dev/null
+++ b/stdlib/tst-atof1.c
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int
+do_test (void)
+{
+  char buf[100];
+  snprintf (buf, sizeof (buf), "%g", atof ("0x10p-1"));
+  if (strcmp (buf, "8") != 0)
+    {
+      printf ("got \"%s\", expected \"8\"\n", buf);
+      return 1;
+    }
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"