diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c index 2ae74e0d28a..65749d16eb0 100644 --- a/dlls/msvcp100/locale.c +++ b/dlls/msvcp100/locale.c @@ -3926,12 +3926,10 @@ static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { - error = TRUE; /* trailing empty */ - }else if(!cur_group) /* no groups, skip loop */ + if(!cur_group) /* no groups, skip loop */ cur_group--; + else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) + error = TRUE; /* trailing empty */ for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -4069,13 +4067,12 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { + if(!cur_group) { /* no groups, skip loop */ + cur_group--; + }else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) { error = TRUE; /* trailing empty */ found_zero = FALSE; - }else if(!cur_group) /* no groups, skip loop */ - cur_group--; + } for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -5020,12 +5017,10 @@ static int num_get_char__Getffld(const num_get *this, char *dest, istreambuf_ite if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { - error = TRUE; /* trailing empty */ - }else if(!cur_group) /* no groups, skip loop */ + if(!cur_group) /* no groups, skip loop */ cur_group--; + else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) + error = TRUE; /* trailing empty */ for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -5160,13 +5155,12 @@ int __cdecl num_get_char__Getifld(const num_get *this, char *dest, istreambuf_it if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { + if(!cur_group) { /* no groups, skip loop */ + cur_group--; + }else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) { error = TRUE; /* trailing empty */ found_zero = FALSE; - }else if(!cur_group) /* no groups, skip loop */ - cur_group--; + } for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { diff --git a/dlls/msvcp60/locale.c b/dlls/msvcp60/locale.c index 72b994ba89c..8b873bbc723 100644 --- a/dlls/msvcp60/locale.c +++ b/dlls/msvcp60/locale.c @@ -4076,12 +4076,10 @@ static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator if(sep && groups_no) basic_string_char_append_ch(&groups_found, groups_no); - groups = basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { - error = TRUE; /* trailing empty */ - }else if(!cur_group) /* no groups, skip loop */ + if(!cur_group) /* no groups, skip loop */ cur_group--; + else if(!(groups = basic_string_char_c_str(&groups_found))[cur_group]) + error = TRUE; /* trailing empty */ for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -4208,13 +4206,12 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator if(sep && groups_no) basic_string_char_append_ch(&groups_found, groups_no); - groups = basic_string_char_c_str(&groups_found); - if(cur_group && groups && !groups[cur_group]) - { + if(!cur_group) { /* no groups, skip loop */ + cur_group--; + }else if(!(groups = basic_string_char_c_str(&groups_found))[cur_group]) { error = TRUE; /* trailing empty */ found_zero = FALSE; - }else if(!cur_group) /* no groups, skip loop */ - cur_group--; + } for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -5138,12 +5135,10 @@ static int num_get_char__Getffld(const num_get *this, char *dest, istreambuf_ite if(sep && groups_no) basic_string_char_append_ch(&groups_found, groups_no); - groups = basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { - error = TRUE; /* trailing empty */ - }else if(!cur_group) /* no groups, skip loop */ + if(!cur_group) /* no groups, skip loop */ cur_group--; + else if(!(groups = basic_string_char_c_str(&groups_found))[cur_group]) + error = TRUE; /* trailing empty */ for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -5269,13 +5264,12 @@ static int num_get_char__Getifld(const num_get *this, char *dest, istreambuf_ite if(sep && groups_no) basic_string_char_append_ch(&groups_found, groups_no); - groups = basic_string_char_c_str(&groups_found); - if(cur_group && groups && !groups[cur_group]) - { + if(!cur_group) { /* no groups, skip loop */ + cur_group--; + }else if(!(groups = basic_string_char_c_str(&groups_found))[cur_group]) { error = TRUE; /* trailing empty */ found_zero = FALSE; - }else if(!cur_group) /* no groups, skip loop */ - cur_group--; + } for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { diff --git a/dlls/msvcp71/locale.c b/dlls/msvcp71/locale.c index 01abd55be57..de5f7faa222 100644 --- a/dlls/msvcp71/locale.c +++ b/dlls/msvcp71/locale.c @@ -4344,12 +4344,10 @@ static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { - error = TRUE; /* trailing empty */ - }else if(!cur_group) /* no groups, skip loop */ + if(!cur_group) /* no groups, skip loop */ cur_group--; + else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) + error = TRUE; /* trailing empty */ for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -4492,13 +4490,12 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { + if(!cur_group) { /* no groups, skip loop */ + cur_group--; + }else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) { error = TRUE; /* trailing empty */ found_zero = FALSE; - }else if(!cur_group) /* no groups, skip loop */ - cur_group--; + } for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -5432,12 +5429,10 @@ int __cdecl num_get_char__Getffld(const num_get *this, char *dest, istreambuf_it if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { - error = TRUE; /* trailing empty */ - }else if(!cur_group) /* no groups, skip loop */ + if(!cur_group) /* no groups, skip loop */ cur_group--; + else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) + error = TRUE; /* trailing empty */ for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -5563,13 +5558,12 @@ int __cdecl num_get_char__Getifld(const num_get *this, char *dest, istreambuf_it if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { + if(!cur_group) { /* no groups, skip loop */ + cur_group--; + }else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) { error = TRUE; /* trailing empty */ found_zero = FALSE; - }else if(!cur_group) /* no groups, skip loop */ - cur_group--; + } for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 1a9e619a3b6..31beeeeedc9 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -4526,12 +4526,10 @@ static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { - error = TRUE; /* trailing empty */ - }else if(!cur_group) /* no groups, skip loop */ + if(!cur_group) /* no groups, skip loop */ cur_group--; + else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) + error = TRUE; /* trailing empty */ for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -4685,13 +4683,12 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { + if(!cur_group) { /* no groups, skip loop */ + cur_group--; + }else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) { error = TRUE; /* trailing empty */ found_zero = FALSE; - }else if(!cur_group) /* no groups, skip loop */ - cur_group--; + } for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -5636,12 +5633,10 @@ int __cdecl num_get_char__Getffld(const num_get *this, char *dest, istreambuf_it if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { - error = TRUE; /* trailing empty */ - }else if(!cur_group) /* no groups, skip loop */ + if(!cur_group) /* no groups, skip loop */ cur_group--; + else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) + error = TRUE; /* trailing empty */ for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) { @@ -5776,13 +5771,12 @@ int __cdecl num_get_char__Getifld(const num_get *this, char *dest, istreambuf_it if(sep && groups_no) MSVCP_basic_string_char_append_ch(&groups_found, groups_no); - groups = MSVCP_basic_string_char_c_str(&groups_found); - if(cur_group && !groups[cur_group]) - { + if(!cur_group) { /* no groups, skip loop */ + cur_group--; + }else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) { error = TRUE; /* trailing empty */ found_zero = FALSE; - }else if(!cur_group) /* no groups, skip loop */ - cur_group--; + } for(; cur_group>=0 && !error; cur_group--) { if(*grouping == CHAR_MAX) {