aboutsummaryrefslogtreecommitdiff
path: root/src/libdraw/getsubfont.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-25 20:26:27 +0000
committerrsc <devnull@localhost>2004-04-25 20:26:27 +0000
commit4e206880423db866dd1db0622a9b4d5b0881fee1 (patch)
treec4a2b577708093741962ca07a0ffcb8cf14ce6cc /src/libdraw/getsubfont.c
parenta2c2caaafe37e119078bc88f6ebee6d338cbff46 (diff)
downloadplan9port-4e206880423db866dd1db0622a9b4d5b0881fee1.tar.gz
plan9port-4e206880423db866dd1db0622a9b4d5b0881fee1.tar.bz2
plan9port-4e206880423db866dd1db0622a9b4d5b0881fee1.zip
make it possible to access fonts without a display.
Diffstat (limited to 'src/libdraw/getsubfont.c')
-rw-r--r--src/libdraw/getsubfont.c6
1 files changed, 3 insertions, 3 deletions
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);