aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/fontfile/bufio.c
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont/src/fontfile/bufio.c')
-rw-r--r--libXfont/src/fontfile/bufio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libXfont/src/fontfile/bufio.c b/libXfont/src/fontfile/bufio.c
index 34b7f3665..d8d4f2964 100644
--- a/libXfont/src/fontfile/bufio.c
+++ b/libXfont/src/fontfile/bufio.c
@@ -162,8 +162,10 @@ BufFileOpenWrite (int fd)
setmode(fd,O_BINARY);
#endif
f = BufFileCreate ((char *)(long) fd, 0, BufFileRawFlush, 0, BufFileFlush);
- f->bufp = f->buffer;
- f->left = BUFFILESIZE;
+ if (f != NULL) {
+ f->bufp = f->buffer;
+ f->left = BUFFILESIZE;
+ }
return f;
}