msvcrt: Don't depend on how __lc_time_data was allocated in _Getdays.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2019-12-04 15:29:59 +01:00 committed by Alexandre Julliard
parent dba7dac458
commit 66d702668a
1 changed files with 5 additions and 2 deletions

View File

@ -456,12 +456,15 @@ static inline char* construct_lc_all(MSVCRT_pthreadlocinfo locinfo) {
char* CDECL _Getdays(void)
{
MSVCRT___lc_time_data *cur = get_locinfo()->lc_time_curr;
int i, len, size;
int i, len, size = 0;
char *out;
TRACE("\n");
size = cur->str.names.short_mon[0]-cur->str.names.short_wday[0];
for(i=0; i<7; i++) {
size += strlen(cur->str.names.short_wday[i]) + 1;
size += strlen(cur->str.names.wday[i]) + 1;
}
out = MSVCRT_malloc(size+1);
if(!out)
return NULL;