From 4e206880423db866dd1db0622a9b4d5b0881fee1 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 25 Apr 2004 20:26:27 +0000 Subject: make it possible to access fonts without a display. --- src/libdraw/getsubfont.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libdraw/getsubfont.c') diff --git a/src/libdraw/getsubfont.c b/src/libdraw/getsubfont.c index b7a8e44a..2cbec812 100644 --- a/src/libdraw/getsubfont.c +++ b/src/libdraw/getsubfont.c @@ -24,10 +24,10 @@ _getsubfont(Display *d, char *name) * _getsubfont is called only from string.c and stringwidth.c, * which are known to be safe to have this done. */ - if(d->locking == 0) + if(d && d->locking == 0) unlockdisplay(d); - f = readsubfont(d, name, fd, d->locking==0); - if(d->locking == 0) + f = readsubfont(d, name, fd, d && d->locking==0); + if(d && d->locking == 0) lockdisplay(d); if(f == 0) fprint(2, "getsubfont: can't read %s: %r\n", name); -- cgit v1.2.3