aboutsummaryrefslogtreecommitdiff
path: root/src/lib/cfuns-c.c
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-05-23 02:18:52 +0000
committerdos-reis <gdr@axiomatics.org>2008-05-23 02:18:52 +0000
commit9f15b051f26f570a820943fd075e8636093ae9ae (patch)
tree22753ccb36ebf358796df73d267f49fcbbfe77e3 /src/lib/cfuns-c.c
parent7d85189b98ae004c095f4c1b58804f021f67880a (diff)
downloadopen-axiom-9f15b051f26f570a820943fd075e8636093ae9ae.tar.gz
Minimize build noise on win32
Diffstat (limited to 'src/lib/cfuns-c.c')
-rw-r--r--src/lib/cfuns-c.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c
index fe5380e8..ff78d8cf 100644
--- a/src/lib/cfuns-c.c
+++ b/src/lib/cfuns-c.c
@@ -524,16 +524,18 @@ oa_get_tmpdir(void)
int bufsz = GetTempPath(0, NULL);
if (bufsz == 0) {
perror("oa_get_tmpdir");
- exit(-1);
+ exit(1);
}
else {
+ int new_size;
buf = (char*) malloc(bufsz + 1);
- if(GetTempPath(bufsz, buf) != bufsz) {
+ new_size = GetTempPath(bufsz, buf);
+ if(new_size = 0 || new_size >= bufsz) {
perror("oa_get_tmpdir");
free(buf);
- exit(-1);
+ exit(1);
}
- buf[bufsz] = '\0';
+ buf[new_size] = '\0';
}
return buf;
#else