mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 10:50:07 +00:00
Update.
* libio/Makefile (tests): Add tst-sscanf. * libio/tst-sscanf.c: New file.
This commit is contained in:
parent
bed381426f
commit
c7509e31d1
@ -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.
|
||||
|
@ -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.
|
||||
|
20
libio/tst-sscanf.c
Normal file
20
libio/tst-sscanf.c
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user