]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 22 Aug 2001 18:40:06 +0000 (18:40 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 22 Aug 2001 18:40:06 +0000 (18:40 +0000)
* libio/Makefile (tests): Add tst-sscanf.
* libio/tst-sscanf.c: New file.

ChangeLog
libio/Makefile
libio/tst-sscanf.c [new file with mode: 0644]

index e3e0b22791cb6e0a161268f7383550f9fb73a9d3..24b56cb38163bff6d066cbd14448e01536a42317 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
        * stdio-common/vfscanf.c: Fix handling of %l[].
        Reported by Mitsuru Chinen <mchinen@yamato.ibm.com>.
 
+       * libio/Makefile (tests): Add tst-sscanf.
+       * libio/tst-sscanf.c: New file.
+
        * elf/dl-addr.c (_dl_addr): Fix tests to determine dli_sname.
        * malloc/mtrace.c (tr_where): dli_sname always points to a
        non-empty string if != NULL.
index ced5c9356859aea0e4269c7b6195718313c03ce2..a10b7dfaa8a70cd891f02a4eea27732ee95edc79 100644 (file)
@@ -48,7 +48,7 @@ routines      :=                                                            \
 
 tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc   \
        tst_wprintf2 tst-widetext test-fmemopen tst-ext tst-fopenloc          \
-       tst-fgetws tst-ungetwc1 tst-ungetwc2 tst-swscanf
+       tst-fgetws tst-ungetwc1 tst-ungetwc2 tst-swscanf tst-sscanf
 test-srcs = test-freopen
 
 all: # Make this the default target; it will be defined in Rules.
diff --git a/libio/tst-sscanf.c b/libio/tst-sscanf.c
new file mode 100644 (file)
index 0000000..b1a2b84
--- /dev/null
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include <wchar.h>
+
+#define WCS_LENGTH 256
+
+int
+main (void)
+{
+  const char cnv[] ="%l[abc]";
+  const char str[] = "abbcXab";
+  wchar_t wcs[WCS_LENGTH];
+  int result = 0;
+
+  sscanf (str, cnv, wcs);
+  printf ("wcs = \"%ls\"\n", wcs);
+  fflush (stdout);
+  result = wcscmp (wcs, L"abbc") != 0;
+
+  return result;
+}