[PATCH v2 7/7] ucrtbase: Handle the _s variant of vsscanf

Martin Storsjo martin at martin.st
Mon Nov 2 15:26:31 CST 2015


There's no need to keep warning about unhandled options now.

The legacy wide flag only is relevant for the wide version of scanf,
which isn't hooked up for ucrtbase yet.

The msvcrt compatbility flag handles which form of inf/nan to parse,
but so far, the msvcrt scanf implementation doesn't handle inf/nan
at all in either form, so the actual state of the flag is irrelevant.

Signed-off-by: Martin Storsjo <martin at martin.st>
---
Rebased on top of the updated version of preceding patches.
---
 dlls/msvcrt/scanf.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcrt/scanf.c b/dlls/msvcrt/scanf.c
index b02977f..11d7f6a 100644
--- a/dlls/msvcrt/scanf.c
+++ b/dlls/msvcrt/scanf.c
@@ -671,9 +671,13 @@ int CDECL MSVCRT__stdio_common_vsscanf(unsigned __int64 options,
                                        MSVCRT__locale_t locale,
                                        __ms_va_list valist)
 {
-    if (options != UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS)
-        FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
-    return MSVCRT_vsnscanf_l(input, length, format, locale, valist);
+    /* LEGACY_WIDE_SPECIFIERS only has got an effect on the wide
+     * scanf. LEGACY_MSVCRT_COMPATIBILITY affects parsing of nan/inf,
+     * but parsing of those isn't implemented at all yet. */
+    if (options & UCRTBASE_SCANF_SECURECRT)
+        return MSVCRT_vsnscanf_s_l(input, length, format, locale, valist);
+    else
+        return MSVCRT_vsnscanf_l(input, length, format, locale, valist);
 }
 
 /*********************************************************************
-- 
1.8.1.2




More information about the wine-patches mailing list