Author: cwittich
Date: Sat Feb 15 19:12:07 2014
New Revision: 62199
URL:
http://svn.reactos.org/svn/reactos?rev=62199&view=rev
Log:
[crt]
partial sync of with wine 1.7.11
Modified:
trunk/reactos/lib/sdk/crt/string/scanf.h
Modified: trunk/reactos/lib/sdk/crt/string/scanf.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/scanf.h…
==============================================================================
--- trunk/reactos/lib/sdk/crt/string/scanf.h [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/string/scanf.h [iso-8859-1] Sat Feb 15 19:12:07 2014
@@ -131,8 +131,14 @@
/* read prefix (if any) */
while (!prefix_finished) {
switch(*format) {
- case 'h': h_prefix = 1; break;
- case 'l': l_prefix = 1; break;
+ case 'h': h_prefix++; break;
+ case 'l':
+ if(*(format+1) == 'l') {
+ I64_prefix = 1;
+ format++;
+ }
+ l_prefix = 1;
+ break;
case 'w': w_prefix = 1; break;
case 'L': L_prefix = 1; break;
case 'I':
@@ -227,15 +233,15 @@
#define _SET_NUMBER_(type) *va_arg(ap, type*) = (type)(negative ? -cur : cur)
if (I64_prefix) _SET_NUMBER_(LONGLONG);
else if (l_prefix) _SET_NUMBER_(LONG);
- else if (h_prefix) _SET_NUMBER_(short int);
+ else if (h_prefix == 1) _SET_NUMBER_(short int);
else _SET_NUMBER_(int);
}
}
break;
- case 'e':
- case 'E':
- case 'f':
- case 'g':
+ case 'e':
+ case 'E':
+ case 'f':
+ case 'g':
case 'G': { /* read a float */
long double cur = 0;
int negative = 0;
@@ -527,6 +533,7 @@
if (nch!=_EOF_) {
_UNGETC_(nch, file);
}
+
TRACE("returning %d\n", rd);
return rd;
}