msvcrt: Remove MSVCRT_wchar_t type.
[wine.git] / dlls / msvcrt / scanf.c
blob2e5b9d1afb2813a0ee88cf8c97acdd58a35aa6fe
1 /*
2 * general implementation of scanf used by scanf, sscanf, fscanf,
3 * _cscanf, wscanf, swscanf and fwscanf
5 * Copyright 1996,1998 Marcus Meissner
6 * Copyright 1996 Jukka Iivonen
7 * Copyright 1997,2000 Uwe Bonnes
8 * Copyright 2000 Jon Griffiths
9 * Copyright 2002 Daniel Gudbjartsson
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include <stdarg.h>
27 #include <limits.h>
28 #include <math.h>
30 #include "windef.h"
31 #include "winbase.h"
32 #include "winternl.h"
33 #include "msvcrt.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
38 /* helper function for *scanf. Returns the value of character c in the
39 * given base, or -1 if the given character is not a digit of the base.
41 static int char2digit(char c, int base) {
42 if ((c>='0') && (c<='9') && (c<='0'+base-1)) return (c-'0');
43 if (base<=10) return -1;
44 if ((c>='A') && (c<='Z') && (c<='A'+base-11)) return (c-'A'+10);
45 if ((c>='a') && (c<='z') && (c<='a'+base-11)) return (c-'a'+10);
46 return -1;
49 /* helper function for *wscanf. Returns the value of character c in the
50 * given base, or -1 if the given character is not a digit of the base.
52 static int wchar2digit(wchar_t c, int base) {
53 if ((c>='0') && (c<='9') && (c<='0'+base-1)) return (c-'0');
54 if (base<=10) return -1;
55 if ((c>='A') && (c<='Z') && (c<='A'+base-11)) return (c-'A'+10);
56 if ((c>='a') && (c<='z') && (c<='a'+base-11)) return (c-'a'+10);
57 return -1;
60 /* vfscanf_l */
61 #undef WIDE_SCANF
62 #undef CONSOLE
63 #undef STRING
64 #undef SECURE
65 #include "scanf.h"
67 /* vfscanf_s_l */
68 #define SECURE 1
69 #include "scanf.h"
71 /* vfwscanf_l */
72 #define WIDE_SCANF 1
73 #undef CONSOLE
74 #undef STRING
75 #undef SECURE
76 #include "scanf.h"
78 /* vfwscanf_s_l */
79 #define SECURE 1
80 #include "scanf.h"
82 /* vsscanf_l */
83 #undef WIDE_SCANF
84 #undef CONSOLE
85 #define STRING 1
86 #undef SECURE
87 #include "scanf.h"
89 /* vsscanf_s_l */
90 #define SECURE 1
91 #include "scanf.h"
93 /* vsnscanf_l */
94 #undef SECURE
95 #define STRING_LEN 1
96 #include "scanf.h"
98 /* vsnscanf_s_l */
99 #define SECURE
100 #include "scanf.h"
101 #undef STRING_LEN
103 /* vswscanf_l */
104 #define WIDE_SCANF 1
105 #undef CONSOLE
106 #define STRING 1
107 #undef SECURE
108 #include "scanf.h"
110 /* vsnwscanf_l */
111 #define STRING_LEN 1
112 #include "scanf.h"
114 /* vsnwscanf_s_l */
115 #define SECURE 1
116 #include "scanf.h"
117 #undef STRING_LEN
119 /* vswscanf_s_l */
120 #define SECURE 1
121 #include "scanf.h"
123 /* vcscanf_l */
124 #undef WIDE_SCANF
125 #define CONSOLE 1
126 #undef STRING
127 #undef SECURE
128 #include "scanf.h"
130 /* vcscanf_s_l */
131 #define SECURE 1
132 #include "scanf.h"
134 /* vcwscanf_l */
135 #define WIDE_SCANF 1
136 #define CONSOLE 1
137 #undef STRING
138 #undef SECURE
139 #include "scanf.h"
141 /* vcwscanf_s_l */
142 #define SECURE 1
143 #include "scanf.h"
146 /*********************************************************************
147 * fscanf (MSVCRT.@)
149 int WINAPIV MSVCRT_fscanf(MSVCRT_FILE *file, const char *format, ...)
151 __ms_va_list valist;
152 int res;
154 __ms_va_start(valist, format);
155 res = MSVCRT_vfscanf_l(file, format, NULL, valist);
156 __ms_va_end(valist);
157 return res;
160 /*********************************************************************
161 * _fscanf_l (MSVCRT.@)
163 int WINAPIV MSVCRT__fscanf_l(MSVCRT_FILE *file, const char *format,
164 _locale_t locale, ...)
166 __ms_va_list valist;
167 int res;
169 __ms_va_start(valist, locale);
170 res = MSVCRT_vfscanf_l(file, format, locale, valist);
171 __ms_va_end(valist);
172 return res;
175 /*********************************************************************
176 * fscanf_s (MSVCRT.@)
178 int WINAPIV MSVCRT_fscanf_s(MSVCRT_FILE *file, const char *format, ...)
180 __ms_va_list valist;
181 int res;
183 __ms_va_start(valist, format);
184 res = MSVCRT_vfscanf_s_l(file, format, NULL, valist);
185 __ms_va_end(valist);
186 return res;
189 /*********************************************************************
190 * _fscanf_s_l (MSVCRT.@)
192 int WINAPIV MSVCRT__fscanf_s_l(MSVCRT_FILE *file, const char *format,
193 _locale_t locale, ...)
195 __ms_va_list valist;
196 int res;
198 __ms_va_start(valist, locale);
199 res = MSVCRT_vfscanf_s_l(file, format, locale, valist);
200 __ms_va_end(valist);
201 return res;
204 /*********************************************************************
205 * scanf (MSVCRT.@)
207 int WINAPIV MSVCRT_scanf(const char *format, ...)
209 __ms_va_list valist;
210 int res;
212 __ms_va_start(valist, format);
213 res = MSVCRT_vfscanf_l(MSVCRT_stdin, format, NULL, valist);
214 __ms_va_end(valist);
215 return res;
218 /*********************************************************************
219 * _scanf_l (MSVCRT.@)
221 int WINAPIV MSVCRT__scanf_l(const char *format, _locale_t locale, ...)
223 __ms_va_list valist;
224 int res;
226 __ms_va_start(valist, locale);
227 res = MSVCRT_vfscanf_l(MSVCRT_stdin, format, locale, valist);
228 __ms_va_end(valist);
229 return res;
232 /*********************************************************************
233 * scanf_s (MSVCRT.@)
235 int WINAPIV MSVCRT_scanf_s(const char *format, ...)
237 __ms_va_list valist;
238 int res;
240 __ms_va_start(valist, format);
241 res = MSVCRT_vfscanf_s_l(MSVCRT_stdin, format, NULL, valist);
242 __ms_va_end(valist);
243 return res;
246 /*********************************************************************
247 * _scanf_s_l (MSVCRT.@)
249 int WINAPIV MSVCRT__scanf_s_l(const char *format, _locale_t locale, ...)
251 __ms_va_list valist;
252 int res;
254 __ms_va_start(valist, locale);
255 res = MSVCRT_vfscanf_s_l(MSVCRT_stdin, format, locale, valist);
256 __ms_va_end(valist);
257 return res;
260 /*********************************************************************
261 * fwscanf (MSVCRT.@)
263 int WINAPIV MSVCRT_fwscanf(MSVCRT_FILE *file, const wchar_t *format, ...)
265 __ms_va_list valist;
266 int res;
268 __ms_va_start(valist, format);
269 res = MSVCRT_vfwscanf_l(file, format, NULL, valist);
270 __ms_va_end(valist);
271 return res;
274 /*********************************************************************
275 * _fwscanf_l (MSVCRT.@)
277 int WINAPIV MSVCRT__fwscanf_l(MSVCRT_FILE *file, const wchar_t *format,
278 _locale_t locale, ...)
280 __ms_va_list valist;
281 int res;
283 __ms_va_start(valist, locale);
284 res = MSVCRT_vfwscanf_l(file, format, locale, valist);
285 __ms_va_end(valist);
286 return res;
289 /*********************************************************************
290 * fwscanf_s (MSVCRT.@)
292 int WINAPIV MSVCRT_fwscanf_s(MSVCRT_FILE *file, const wchar_t *format, ...)
294 __ms_va_list valist;
295 int res;
297 __ms_va_start(valist, format);
298 res = MSVCRT_vfwscanf_s_l(file, format, NULL, valist);
299 __ms_va_end(valist);
300 return res;
303 /*********************************************************************
304 * _fwscanf_s_l (MSVCRT.@)
306 int WINAPIV MSVCRT__fwscanf_s_l(MSVCRT_FILE *file, const wchar_t *format,
307 _locale_t locale, ...)
309 __ms_va_list valist;
310 int res;
312 __ms_va_start(valist, locale);
313 res = MSVCRT_vfwscanf_s_l(file, format, locale, valist);
314 __ms_va_end(valist);
315 return res;
318 /*********************************************************************
319 * wscanf (MSVCRT.@)
321 int WINAPIV MSVCRT_wscanf(const wchar_t *format, ...)
323 __ms_va_list valist;
324 int res;
326 __ms_va_start(valist, format);
327 res = MSVCRT_vfwscanf_l(MSVCRT_stdin, format, NULL, valist);
328 __ms_va_end(valist);
329 return res;
332 /*********************************************************************
333 * _wscanf_l (MSVCRT.@)
335 int WINAPIV MSVCRT__wscanf_l(const wchar_t *format,
336 _locale_t locale, ...)
338 __ms_va_list valist;
339 int res;
341 __ms_va_start(valist, locale);
342 res = MSVCRT_vfwscanf_l(MSVCRT_stdin, format, locale, valist);
343 __ms_va_end(valist);
344 return res;
347 /*********************************************************************
348 * wscanf_s (MSVCRT.@)
350 int WINAPIV MSVCRT_wscanf_s(const wchar_t *format, ...)
352 __ms_va_list valist;
353 int res;
355 __ms_va_start(valist, format);
356 res = MSVCRT_vfwscanf_s_l(MSVCRT_stdin, format, NULL, valist);
357 __ms_va_end(valist);
358 return res;
361 /*********************************************************************
362 * _wscanf_s_l (MSVCRT.@)
364 int WINAPIV MSVCRT__wscanf_s_l(const wchar_t *format,
365 _locale_t locale, ...)
367 __ms_va_list valist;
368 int res;
370 __ms_va_start(valist, locale);
371 res = MSVCRT_vfwscanf_s_l(MSVCRT_stdin, format, locale, valist);
372 __ms_va_end(valist);
373 return res;
376 /*********************************************************************
377 * sscanf (MSVCRT.@)
379 int WINAPIV MSVCRT_sscanf(const char *str, const char *format, ...)
381 __ms_va_list valist;
382 int res;
384 __ms_va_start(valist, format);
385 res = MSVCRT_vsscanf_l(str, format, NULL, valist);
386 __ms_va_end(valist);
387 return res;
390 /*********************************************************************
391 * _sscanf_l (MSVCRT.@)
393 int WINAPIV MSVCRT__sscanf_l(const char *str, const char *format,
394 _locale_t locale, ...)
396 __ms_va_list valist;
397 int res;
399 __ms_va_start(valist, locale);
400 res = MSVCRT_vsscanf_l(str, format, locale, valist);
401 __ms_va_end(valist);
402 return res;
405 /*********************************************************************
406 * sscanf_s (MSVCRT.@)
408 int WINAPIV MSVCRT_sscanf_s(const char *str, const char *format, ...)
410 __ms_va_list valist;
411 int res;
413 __ms_va_start(valist, format);
414 res = MSVCRT_vsscanf_s_l(str, format, NULL, valist);
415 __ms_va_end(valist);
416 return res;
419 /*********************************************************************
420 * _sscanf_s_l (MSVCRT.@)
422 int WINAPIV MSVCRT__sscanf_s_l(const char *str, const char *format,
423 _locale_t locale, ...)
425 __ms_va_list valist;
426 int res;
428 __ms_va_start(valist, locale);
429 res = MSVCRT_vsscanf_s_l(str, format, locale, valist);
430 __ms_va_end(valist);
431 return res;
434 /*********************************************************************
435 * swscanf (MSVCRT.@)
437 int WINAPIV MSVCRT_swscanf(const wchar_t *str, const wchar_t *format, ...)
439 __ms_va_list valist;
440 int res;
442 __ms_va_start(valist, format);
443 res = MSVCRT_vswscanf_l(str, format, NULL, valist);
444 __ms_va_end(valist);
445 return res;
448 /*********************************************************************
449 * _swscanf_l (MSVCRT.@)
451 int WINAPIV MSVCRT__swscanf_l(const wchar_t *str, const wchar_t *format,
452 _locale_t locale, ...)
454 __ms_va_list valist;
455 int res;
457 __ms_va_start(valist, locale);
458 res = MSVCRT_vswscanf_l(str, format, locale, valist);
459 __ms_va_end(valist);
460 return res;
463 /*********************************************************************
464 * swscanf_s (MSVCRT.@)
466 int WINAPIV MSVCRT_swscanf_s(const wchar_t *str, const wchar_t *format, ...)
468 __ms_va_list valist;
469 int res;
471 __ms_va_start(valist, format);
472 res = MSVCRT_vswscanf_s_l(str, format, NULL, valist);
473 __ms_va_end(valist);
474 return res;
477 /*********************************************************************
478 * _swscanf_s_l (MSVCRT.@)
480 int WINAPIV MSVCRT__swscanf_s_l(const wchar_t *str, const wchar_t *format,
481 _locale_t locale, ...)
483 __ms_va_list valist;
484 int res;
486 __ms_va_start(valist, locale);
487 res = MSVCRT_vswscanf_s_l(str, format, locale, valist);
488 __ms_va_end(valist);
489 return res;
492 /*********************************************************************
493 * _cscanf (MSVCRT.@)
495 int WINAPIV _cscanf(const char *format, ...)
497 __ms_va_list valist;
498 int res;
500 __ms_va_start(valist, format);
501 res = MSVCRT_vcscanf_l(format, NULL, valist);
502 __ms_va_end(valist);
503 return res;
506 /*********************************************************************
507 * _cscanf_l (MSVCRT.@)
509 int WINAPIV _cscanf_l(const char *format, _locale_t locale, ...)
511 __ms_va_list valist;
512 int res;
514 __ms_va_start(valist, locale);
515 res = MSVCRT_vcscanf_l(format, locale, valist);
516 __ms_va_end(valist);
517 return res;
520 /*********************************************************************
521 * _cscanf_s (MSVCRT.@)
523 int WINAPIV _cscanf_s(const char *format, ...)
525 __ms_va_list valist;
526 int res;
528 __ms_va_start(valist, format);
529 res = MSVCRT_vcscanf_s_l(format, NULL, valist);
530 __ms_va_end(valist);
531 return res;
534 /*********************************************************************
535 * _cscanf_s_l (MSVCRT.@)
537 int WINAPIV _cscanf_s_l(const char *format, _locale_t locale, ...)
539 __ms_va_list valist;
540 int res;
542 __ms_va_start(valist, locale);
543 res = MSVCRT_vcscanf_s_l(format, locale, valist);
544 __ms_va_end(valist);
545 return res;
548 /*********************************************************************
549 * _cwscanf (MSVCRT.@)
551 int WINAPIV _cwscanf(const wchar_t *format, ...)
553 __ms_va_list valist;
554 int res;
556 __ms_va_start(valist, format);
557 res = MSVCRT_vcwscanf_l(format, NULL, valist);
558 __ms_va_end(valist);
559 return res;
562 /*********************************************************************
563 * _cwscanf_l (MSVCRT.@)
565 int WINAPIV _cwscanf_l(const wchar_t *format, _locale_t locale, ...)
567 __ms_va_list valist;
568 int res;
570 __ms_va_start(valist, locale);
571 res = MSVCRT_vcwscanf_l(format, locale, valist);
572 __ms_va_end(valist);
573 return res;
576 /*********************************************************************
577 * _cwscanf_s (MSVCRT.@)
579 int WINAPIV _cwscanf_s(const wchar_t *format, ...)
581 __ms_va_list valist;
582 int res;
584 __ms_va_start(valist, format);
585 res = MSVCRT_vcwscanf_s_l(format, NULL, valist);
586 __ms_va_end(valist);
587 return res;
590 /*********************************************************************
591 * _cwscanf_s_l (MSVCRT.@)
593 int WINAPIV _cwscanf_s_l(const wchar_t *format, _locale_t locale, ...)
595 __ms_va_list valist;
596 int res;
598 __ms_va_start(valist, locale);
599 res = MSVCRT_vcwscanf_s_l(format, locale, valist);
600 __ms_va_end(valist);
601 return res;
604 /*********************************************************************
605 * _snscanf (MSVCRT.@)
607 int WINAPIV MSVCRT__snscanf(char *input, MSVCRT_size_t length, const char *format, ...)
609 __ms_va_list valist;
610 int res;
612 __ms_va_start(valist, format);
613 res = MSVCRT_vsnscanf_l(input, length, format, NULL, valist);
614 __ms_va_end(valist);
615 return res;
618 /*********************************************************************
619 * _snscanf_l (MSVCRT.@)
621 int WINAPIV MSVCRT__snscanf_l(char *input, MSVCRT_size_t length,
622 const char *format, _locale_t locale, ...)
624 __ms_va_list valist;
625 int res;
627 __ms_va_start(valist, locale);
628 res = MSVCRT_vsnscanf_l(input, length, format, locale, valist);
629 __ms_va_end(valist);
630 return res;
633 /*********************************************************************
634 * _snscanf_s (MSVCRT.@)
636 int WINAPIV MSVCRT__snscanf_s(char *input, MSVCRT_size_t length, const char *format, ...)
638 __ms_va_list valist;
639 int res;
641 __ms_va_start(valist, format);
642 res = MSVCRT_vsnscanf_s_l(input, length, format, NULL, valist);
643 __ms_va_end(valist);
644 return res;
647 /*********************************************************************
648 * _snscanf_s_l (MSVCRT.@)
650 int WINAPIV MSVCRT__snscanf_s_l(char *input, MSVCRT_size_t length,
651 const char *format, _locale_t locale, ...)
653 __ms_va_list valist;
654 int res;
656 __ms_va_start(valist, locale);
657 res = MSVCRT_vsnscanf_s_l(input, length, format, locale, valist);
658 __ms_va_end(valist);
659 return res;
663 /*********************************************************************
664 * __stdio_common_vsscanf (UCRTBASE.@)
666 int CDECL MSVCRT__stdio_common_vsscanf(unsigned __int64 options,
667 const char *input, MSVCRT_size_t length,
668 const char *format,
669 _locale_t locale,
670 __ms_va_list valist)
672 /* LEGACY_WIDE_SPECIFIERS only has got an effect on the wide
673 * scanf. LEGACY_MSVCRT_COMPATIBILITY affects parsing of nan/inf,
674 * but parsing of those isn't implemented at all yet. */
675 if (options & ~UCRTBASE_SCANF_MASK)
676 FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
677 if (options & UCRTBASE_SCANF_SECURECRT)
678 return MSVCRT_vsnscanf_s_l(input, length, format, locale, valist);
679 else
680 return MSVCRT_vsnscanf_l(input, length, format, locale, valist);
683 /*********************************************************************
684 * __stdio_common_vswscanf (UCRTBASE.@)
686 int CDECL MSVCRT__stdio_common_vswscanf(unsigned __int64 options,
687 const wchar_t *input, MSVCRT_size_t length,
688 const wchar_t *format,
689 _locale_t locale,
690 __ms_va_list valist)
692 /* LEGACY_WIDE_SPECIFIERS only has got an effect on the wide
693 * scanf. LEGACY_MSVCRT_COMPATIBILITY affects parsing of nan/inf,
694 * but parsing of those isn't implemented at all yet. */
695 if (options & ~UCRTBASE_SCANF_MASK)
696 FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
697 if (options & UCRTBASE_SCANF_SECURECRT)
698 return MSVCRT_vsnwscanf_s_l(input, length, format, locale, valist);
699 else
700 return MSVCRT_vsnwscanf_l(input, length, format, locale, valist);
703 /*********************************************************************
704 * __stdio_common_vfscanf (UCRTBASE.@)
706 int CDECL MSVCRT__stdio_common_vfscanf(unsigned __int64 options,
707 MSVCRT_FILE *file,
708 const char *format,
709 _locale_t locale,
710 __ms_va_list valist)
712 if (options & ~UCRTBASE_SCANF_SECURECRT)
713 FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
714 if (options & UCRTBASE_SCANF_SECURECRT)
715 return MSVCRT_vfscanf_s_l(file, format, locale, valist);
716 else
717 return MSVCRT_vfscanf_l(file, format, locale, valist);
720 /*********************************************************************
721 * __stdio_common_vfwscanf (UCRTBASE.@)
723 int CDECL MSVCRT__stdio_common_vfwscanf(unsigned __int64 options,
724 MSVCRT_FILE *file,
725 const wchar_t *format,
726 _locale_t locale,
727 __ms_va_list valist)
729 if (options & ~UCRTBASE_SCANF_SECURECRT)
730 FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
731 if (options & UCRTBASE_SCANF_SECURECRT)
732 return MSVCRT_vfwscanf_s_l(file, format, locale, valist);
733 else
734 return MSVCRT_vfwscanf_l(file, format, locale, valist);
737 /*********************************************************************
738 * _snwscanf (MSVCRT.@)
740 int WINAPIV MSVCRT__snwscanf(wchar_t *input, MSVCRT_size_t length,
741 const wchar_t *format, ...)
743 __ms_va_list valist;
744 int res;
746 __ms_va_start(valist, format);
747 res = MSVCRT_vsnwscanf_l(input, length, format, NULL, valist);
748 __ms_va_end(valist);
749 return res;
752 /*********************************************************************
753 * _snwscanf_l (MSVCRT.@)
755 int WINAPIV MSVCRT__snwscanf_l(wchar_t *input, MSVCRT_size_t length,
756 const wchar_t *format, _locale_t locale, ...)
758 __ms_va_list valist;
759 int res;
761 __ms_va_start(valist, locale);
762 res = MSVCRT_vsnwscanf_l(input, length, format, locale, valist);
763 __ms_va_end(valist);
764 return res;
767 /*********************************************************************
768 * _snwscanf_s (MSVCRT.@)
770 int WINAPIV MSVCRT__snwscanf_s(wchar_t *input, MSVCRT_size_t length,
771 const wchar_t *format, ...)
773 __ms_va_list valist;
774 int res;
776 __ms_va_start(valist, format);
777 res = MSVCRT_vsnwscanf_s_l(input, length, format, NULL, valist);
778 __ms_va_end(valist);
779 return res;
782 /*********************************************************************
783 * _snscanf_s_l (MSVCRT.@)
785 int WINAPIV MSVCRT__snwscanf_s_l(wchar_t *input, MSVCRT_size_t length,
786 const wchar_t *format, _locale_t locale, ...)
788 __ms_va_list valist;
789 int res;
791 __ms_va_start(valist, locale);
792 res = MSVCRT_vsnwscanf_s_l(input, length, format, locale, valist);
793 __ms_va_end(valist);
794 return res;
797 #if _MSVCR_VER>=120
799 /*********************************************************************
800 * vsscanf (MSVCRT120.@)
802 int CDECL MSVCRT_vsscanf(const char *buffer, const char *format, __ms_va_list valist)
804 if (!MSVCRT_CHECK_PMT(buffer != NULL && format != NULL)) return -1;
806 return MSVCRT_vsscanf_l(buffer, format, NULL, valist);
809 /*********************************************************************
810 * vswscanf (MSVCRT120.@)
812 int CDECL MSVCRT_vswscanf(const wchar_t *buffer, const wchar_t *format, __ms_va_list valist)
814 if (!MSVCRT_CHECK_PMT(buffer != NULL && format != NULL)) return -1;
816 return MSVCRT_vswscanf_l(buffer, format, NULL, valist);
819 #endif /* _MSVCR_VER>=120 */