/** @file\r
Implementation of scanf internals for <stdio.h>.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License that accompanies this\r
distribution. The full text of the license may be found at\r
static int\r
__collate_range_cmp(int c1, int c2)\r
{\r
- static char s1[2], s2[2];\r
+ static char s1[2] = { {0}, {0} };\r
+ static char s2[2] = { {0}, {0} };\r
\r
s1[0] = (char)c1;\r
s2[0] = (char)c2;\r
int\r
__svfscanf_unlocked(FILE *fp, const char *fmt0, va_list ap)\r
{\r
- const u_char *fmt = (const u_char *)fmt0;\r
- int c; /* character from format, or conversion */\r
- size_t width; /* field width, or 0 */\r
- char *p; /* points into all kinds of strings */\r
- size_t n; /* handy size_t */\r
- int flags; /* flags as defined above */\r
- char *p0; /* saves original value of p when necessary */\r
- int nassigned; /* number of fields assigned */\r
- int nconversions; /* number of conversions */\r
- int nread; /* number of characters consumed from fp */\r
- int base; /* base argument to conversion function */\r
- char ccltab[256]; /* character class table for %[...] */\r
- char buf[BUF]; /* buffer for numeric and mb conversions */\r
- wchar_t *wcp; /* handy wide character pointer */\r
- size_t nconv; /* length of multibyte sequence converted */\r
- static const mbstate_t initial = { 0 };\r
- mbstate_t mbs;\r
+ const u_char *fmt = (const u_char *)fmt0;\r
+ int c; /* character from format, or conversion */\r
+ size_t width; /* field width, or 0 */\r
+ char *p; /* points into all kinds of strings */\r
+ size_t n; /* handy size_t */\r
+ int flags; /* flags as defined above */\r
+ char *p0; /* saves original value of p when necessary */\r
+ int nassigned; /* number of fields assigned */\r
+ int nconversions; /* number of conversions */\r
+ int nread; /* number of characters consumed from fp */\r
+ int base; /* base argument to conversion function */\r
+ char ccltab[256]; /* character class table for %[...] */\r
+ char buf[BUF]; /* buffer for numeric and mb conversions */\r
+ wchar_t *wcp; /* handy wide character pointer */\r
+ size_t nconv; /* length of multibyte sequence converted */\r
+ static const mbstate_t initial = { 0 };\r
+ mbstate_t mbs;\r
\r
/* `basefix' is used to avoid `if' tests in the integer scanner */\r
static const short basefix[17] =\r
goto match_failure;\r
if ((flags & SUPPRESS) == 0) {\r
if (flags & LONGDBL) {\r
- long double **mp = (long double **)ap;\r
long double res = strtold(buf, &p);\r
-\r
- *(*mp) = res;\r
- ap += sizeof(long double *);\r
-/*???*/ //*va_arg(ap, long double *) = res;\r
+ *va_arg(ap, long double *) = res;\r
} else if (flags & LONG) {\r
double res = strtod(buf, &p);\r
*va_arg(ap, double *) = res;\r