summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-09-30 15:43:58 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2011-09-30 15:46:49 +0200
commit358a15fd65cdc56ddc02b3ea261851f20c7ac618 (patch)
tree73813db6e2bde7f4e04dde0136a763f8f50e7ee2 /src
parent550c9f31bb782f11483f146dd69b1ec7d2e530a3 (diff)
downloadlibgit2-358a15fd65cdc56ddc02b3ea261851f20c7ac618.tar.gz
config: fix check for environment string expansion
If ExpandEnvironmentStringsW is successful, it returns the amount of characters written, including the NUL terminator. Thanks to Emeric for reading the MSDN documentation correctly. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'src')
-rw-r--r--src/config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index c4f3807c2..54727c0f6 100644
--- a/src/config.c
+++ b/src/config.c
@@ -352,7 +352,7 @@ static int win32_find_system(char *system_config_path)
return GIT_ENOMEM;
ret = ExpandEnvironmentStringsW(query, apphome_utf16, size);
- if (ret == 0 || ret >= size)
+ if (ret != size)
return git__throw(GIT_ERROR, "Failed to expand environment strings");
if (_waccess(apphome_utf16, F_OK) < 0) {