summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-25 00:43:21 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-25 00:43:21 -0800
commitb14b352a6416e29f2ca0db31fd32195bbcc384a9 (patch)
treeb3345a0db304224940ee2923b51394c37aa939c1 /stream.c
parentef976f0374d3a938c6d575cc42ca74f711b20e11 (diff)
downloadtxr-b14b352a6416e29f2ca0db31fd32195bbcc384a9.tar.gz
txr-b14b352a6416e29f2ca0db31fd32195bbcc384a9.tar.bz2
txr-b14b352a6416e29f2ca0db31fd32195bbcc384a9.zip
* stream.c (getcwd_wrap): Implement correct test of getcwd's
return value.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index 190932d8..68a1e772 100644
--- a/stream.c
+++ b/stream.c
@@ -2424,7 +2424,8 @@ val getcwd_wrap(void)
for (;;) {
char *u8buf = (char *) chk_malloc(guess);
- if (getcwd(u8buf, 256) < 0) {
+
+ if (getcwd(u8buf, guess) == 0) {
free(u8buf);
if (errno != ERANGE) {
uw_throwf(file_error_s, lit("getcwd: ~a/~s"),