Fixed all instances of the usage of wcstombs to use a sizeof() of whatever the destination is instead of the source size.

This commit is contained in:
OBattler
2017-07-20 11:32:41 +02:00
parent b18f16c4bc
commit 3e195b74d0
5 changed files with 11 additions and 10 deletions

View File

@@ -225,7 +225,7 @@ int config_load(wchar_t *fn)
strncpy(new_entry->name, ename, 256);
memcpy(new_entry->wdata, &cfgbuffer[data_pos], 512);
new_entry->wdata[255] = L'\0';
wcstombs(new_entry->data, new_entry->wdata, 512);
wcstombs(new_entry->data, new_entry->wdata, sizeof(new_entry->data));
new_entry->data[255] = '\0';
list_add(&new_entry->list, &current_section->entry_head);
}