summaryrefslogtreecommitdiff
path: root/wcsmbs
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-08-05 23:36:21 +0000
committerUlrich Drepper <drepper@redhat.com>1997-08-05 23:36:21 +0000
commit044b16f4e9ae773187f4fee8a9a0a54f9a51f13f (patch)
tree58bc41e16535e0d0f61d51e6af15ce4128864fc9 /wcsmbs
parentc59a94711c6a9d38811b828863076f39000831b4 (diff)
update for 2.0.5pre1
Diffstat (limited to 'wcsmbs')
-rw-r--r--wcsmbs/Makefile2
-rw-r--r--wcsmbs/tst-wcstof.c23
-rw-r--r--wcsmbs/wcstof.c2
3 files changed, 26 insertions, 1 deletions
diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
index c296944fdd..91bcf081d1 100644
--- a/wcsmbs/Makefile
+++ b/wcsmbs/Makefile
@@ -34,6 +34,8 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
wcscoll wcsxfrm \
wcwidth wcswidth
+tests := tst-wcstof
+
include ../Rules
CFLAGS-wcwidth.c = -I../wctype
diff --git a/wcsmbs/tst-wcstof.c b/wcsmbs/tst-wcstof.c
new file mode 100644
index 0000000000..197cb5c770
--- /dev/null
+++ b/wcsmbs/tst-wcstof.c
@@ -0,0 +1,23 @@
+#define _GNU_SOURCE 1
+#include <wchar.h>
+#include <stdio.h>
+#include <string.h>
+#include <wctype.h>
+
+int
+main (void)
+{
+ int result = 0;
+ char buf[100];
+ wchar_t tmp[3];
+ tmp[0] = '8';
+ tmp[1] = '1';
+ tmp[2] = 0;
+
+ snprintf (buf, 100, "%S = %f", tmp, wcstof (tmp, NULL));
+ printf ("\"%s\" -> %s\n", buf,
+ strcmp (buf, "81 = 81.000000") == 0 ? "okay" : "buggy");
+ result |= strcmp (buf, "81 = 81.000000") != 0;
+
+ return result;
+}
diff --git a/wcsmbs/wcstof.c b/wcsmbs/wcstof.c
index 01a8950ed4..1e86f556d3 100644
--- a/wcsmbs/wcstof.c
+++ b/wcsmbs/wcstof.c
@@ -22,7 +22,7 @@
These macros tell it to produce the `float' version, `wcstof'. */
#define FLOAT float
-#define FLT LDBL
+#define FLT FLT
#define STRTOF wcstof
#define MPN2FLOAT __mpn_construct_float
#define FLOAT_HUGE_VAL HUGE_VALf