msvcp: Fix format parsing in time_put_wchar_put_format.

This commit is contained in:
Piotr Caban 2015-01-09 08:29:16 +01:00 committed by Alexandre Julliard
parent 35a887acc5
commit 998472d1eb
2 changed files with 8 additions and 6 deletions

View File

@ -7589,15 +7589,16 @@ ostreambuf_iterator_wchar* __thiscall time_put_wchar_put_format(const time_put *
ostreambuf_iterator_wchar_put(&dest, *pat++);
}else if(++pat == pat_end) {
ostreambuf_iterator_wchar_put(&dest, percent);
}else if(!_Wcrtomb(c, *pat, NULL, &this->cvt) || (*c=='#' && pat+1==pat_end)) {
}else if(_Wcrtomb(c, *pat, NULL, &this->cvt)!=1 || (*c=='#' && pat+1==pat_end)) {
ostreambuf_iterator_wchar_put(&dest, percent);
ostreambuf_iterator_wchar_put(&dest, *pat++);
}else {
pat++;
if(*c == '#') {
if(!_Wcrtomb(c, *pat++, NULL, &this->cvt)) {
if(_Wcrtomb(c, *pat++, NULL, &this->cvt) != 1) {
ostreambuf_iterator_wchar_put(&dest, percent);
ostreambuf_iterator_wchar_put(&dest, *(pat-2));
ostreambuf_iterator_wchar_put(&dest, *(pat-1));
ostreambuf_iterator_wchar_put(&dest, *pat);
}else {
time_put_wchar_put(this, &dest, dest, base, t, *c, '#');
}

View File

@ -9249,15 +9249,16 @@ ostreambuf_iterator_wchar* __thiscall time_put_wchar_put_format(const time_put *
ostreambuf_iterator_wchar_put(&dest, *pat++);
}else if(++pat == pat_end) {
ostreambuf_iterator_wchar_put(&dest, percent);
}else if(!_Wcrtomb(c, *pat, NULL, &this->cvt) || (*c=='#' && pat+1==pat_end)) {
}else if(_Wcrtomb(c, *pat, NULL, &this->cvt)!=1 || (*c=='#' && pat+1==pat_end)) {
ostreambuf_iterator_wchar_put(&dest, percent);
ostreambuf_iterator_wchar_put(&dest, *pat++);
}else {
pat++;
if(*c == '#') {
if(!_Wcrtomb(c, *pat++, NULL, &this->cvt)) {
if(_Wcrtomb(c, *pat++, NULL, &this->cvt) != 1) {
ostreambuf_iterator_wchar_put(&dest, percent);
ostreambuf_iterator_wchar_put(&dest, *(pat-2));
ostreambuf_iterator_wchar_put(&dest, *(pat-1));
ostreambuf_iterator_wchar_put(&dest, *pat);
}else {
time_put_wchar_put(this, &dest, dest, base, fill, t, *c, '#');
}