summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index f6c0f89ca6..d74337ffb5 100644
--- a/io.c
+++ b/io.c
@@ -880,7 +880,7 @@ io_unbuffered(fptr)
OpenFile *fptr;
{
if (fptr->f2 == 0) TypeError("non-writable fptr");
- setbuf(fptr->f, NULL);
+ if (fptr->f != 0) setbuf(fptr->f, NULL);
setbuf(fptr->f2, NULL);
fptr->mode |= FMODE_SYNC;
}