[core] partitioning improvements

* Improve report and make sure we zero leftovers from the start of a partition
* Also add VDS error codes
* Also fix Coverity warnings
This commit is contained in:
Pete Batard 2019-04-27 16:04:47 +01:00
parent 1c39a80d72
commit 5f9e65707f
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
7 changed files with 521 additions and 58 deletions

View file

@ -1038,8 +1038,10 @@ static __inline char* getenvU(const char* varname)
// _wgetenv() is *BROKEN* in MS compilers => use GetEnvironmentVariableW()
DWORD dwSize = GetEnvironmentVariableW(wvarname, wbuf, 0);
wbuf = calloc(dwSize, sizeof(wchar_t));
if (wbuf == NULL)
if (wbuf == NULL) {
wfree(varname);
return NULL;
}
dwSize = GetEnvironmentVariableW(wvarname, wbuf, dwSize);
if (dwSize != 0)
ret = wchar_to_utf8(wbuf);