diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-03-01 05:39:45 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-03-01 05:39:45 +0100 |
commit | e725771b5d8a78fd8ade6062925894cfe3f1d4d1 (patch) | |
tree | fb20fe2146493874ea67a0002e755ab07c0221ed /sys/src/libdraw | |
parent | 7cdc13accc1735d6b047d3e99f69df023b221908 (diff) |
libdraw: use readn() to read headers and Fontchar array
the Fontchar array might be bigger than the i/o unit,
so we have to use readn() to properly read it.
Diffstat (limited to 'sys/src/libdraw')
-rw-r--r-- | sys/src/libdraw/readsubfont.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/libdraw/readsubfont.c b/sys/src/libdraw/readsubfont.c index 52c191559..df2067912 100644 --- a/sys/src/libdraw/readsubfont.c +++ b/sys/src/libdraw/readsubfont.c @@ -19,7 +19,7 @@ readsubfonti(Display*d, char *name, int fd, Image *ai, int dolock) return nil; } p = nil; - if(read(fd, hdr, 3*12) != 3*12){ + if(readn(fd, hdr, 3*12) != 3*12){ werrstr("readsubfont: header read error: %r"); goto Err; } @@ -31,7 +31,7 @@ readsubfonti(Display*d, char *name, int fd, Image *ai, int dolock) p = malloc(6*(n+1)); if(p == nil) goto Err; - if(read(fd, p, 6*(n+1)) != 6*(n+1)){ + if(readn(fd, p, 6*(n+1)) != 6*(n+1)){ werrstr("readsubfont: fontchar read error: %r"); goto Err; } |