X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Flib%2Fsdk%2Fcrt%2Fstring%2Fscanf.h;h=b27eb5626aa9df61575698bfdfb1158e32e5119d;hp=4d904bdfd282a271935eaf35456ef50a542f7f45;hb=ac49d0b2d38cb5e2d7bcd770bf1ce963384cf1f6;hpb=484e8c8db206514a292e78c12000932d9a09d974;ds=sidebyside diff --git a/reactos/lib/sdk/crt/string/scanf.h b/reactos/lib/sdk/crt/string/scanf.h index 4d904bdfd28..b27eb5626aa 100644 --- a/reactos/lib/sdk/crt/string/scanf.h +++ b/reactos/lib/sdk/crt/string/scanf.h @@ -131,8 +131,14 @@ _FUNCTION_ { /* 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 @@ _FUNCTION_ { #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 @@ _FUNCTION_ { if (nch!=_EOF_) { _UNGETC_(nch, file); } + TRACE("returning %d\n", rd); return rd; }