diff options
author | Simon Tatham <anakin@pobox.com> | 2017-05-16 19:19:51 +0100 |
---|---|---|
committer | Simon Tatham <anakin@pobox.com> | 2017-05-16 19:19:51 +0100 |
commit | dc057115b5068fe6edf209a706a43893a67f3469 (patch) | |
tree | 23f9e1525e3ccabbbd16b09d7cd1418f97ade0cc | |
parent | 74592eecf350ca3dad569b6bfa8820d3f2f922db (diff) | |
download | wix-on-linux-dc057115b5068fe6edf209a706a43893a67f3469.tar.gz wix-on-linux-dc057115b5068fe6edf209a706a43893a67f3469.tar.bz2 wix-on-linux-dc057115b5068fe6edf209a706a43893a67f3469.zip |
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.
-rw-r--r-- | fake-msi.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -25,6 +25,11 @@ uint32_t MsiGetFileVersionW(const char16_t *filename, | |||
25 | int fd = -1; | 25 | int fd = -1; |
26 | void *mapv = MAP_FAILED; | 26 | void *mapv = MAP_FAILED; |
27 | 27 | ||
28 | if (version && *version_size) | ||
29 | *version = 0; | ||
30 | if (language && *language_size) | ||
31 | *language = 0; | ||
32 | |||
28 | fd = open(fname, O_RDONLY); | 33 | fd = open(fname, O_RDONLY); |
29 | if (fd < 0) | 34 | if (fd < 0) |
30 | err(1, "%s: open", fname); | 35 | err(1, "%s: open", fname); |