Write terminating strings when MsiGetFileVersion() fails.
I had expected that if you were returning a failure code you didn't have to - perhaps even _shouldn't_ - write through the output pointer arguments. But in fact, now that my implementation of MsiGetFileVersion _knows_ how to fail (i.e. doesn't just return a hardcoded value for every call), the MSI build doesn't work unless I also clear the output strings in the case of failure.
This commit is contained in:
parent
74592eecf3
commit
dc057115b5
1 changed files with 5 additions and 0 deletions
|
@ -25,6 +25,11 @@ uint32_t MsiGetFileVersionW(const char16_t *filename,
|
|||
int fd = -1;
|
||||
void *mapv = MAP_FAILED;
|
||||
|
||||
if (version && *version_size)
|
||||
*version = 0;
|
||||
if (language && *language_size)
|
||||
*language = 0;
|
||||
|
||||
fd = open(fname, O_RDONLY);
|
||||
if (fd < 0)
|
||||
err(1, "%s: open", fname);
|
||||
|
|
Loading…
Add table
Reference in a new issue