problem in swscanf
Corinna Vinschen
vinschen@redhat.com
Wed Aug 5 12:22:00 GMT 2015
Hi,
On Aug 3 10:11, Shoichi Sakon wrote:
> Hi,
>
> It seems there is a problem in swscanf.
>
> Here is a test program.
> ----------------------------------------------------------
> #include <stdio.h>
> #include <wchar.h>
> #define SIZE 100
>
> main() {
> const wchar_t *ws = L"ab cd ef";
> wchar_t x[SIZE],y[SIZE],z[SIZE];
> int ret;
>
> ret = swscanf(ws, L"%3$l[ab] %2$ls %1$lc",x,y,z);
> wprintf(L"ret=%d x=%lc y=%ls z=%ls\n",ret,*x,y,z);
> }
> -----------------------------------------------------------
>
> In case of l[], ls or lc format, it does not handle %n$ properly,
> null character is not add, and/or return value is not correct.
>
> I made an experimental patch to try to correct them.
> Please take a look.
the patch looks good. It was malformed (somehow all TABs got replaced
with spaces in your patch) but contentwise it's fine. I applied the
patch with fixed formatting.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20150805/73f3a643/attachment.sig>
More information about the Newlib
mailing list