mirror of https://github.com/0intro/wmii
[wmiir] Flush conversion buffer on short read. Closes issue #235.
This commit is contained in:
parent
6594959ce8
commit
0a694fe4ea
|
@ -322,8 +322,11 @@ xread(int argc, char *argv[]) {
|
|||
fatal("Can't open file '%s': %r\n", file);
|
||||
|
||||
buf = emalloc(fid->iounit);
|
||||
while((count = ixp_read(fid, buf, fid->iounit)) > 0)
|
||||
while((count = ixp_read(fid, buf, fid->iounit)) > 0) {
|
||||
unflush(1, buf, count, binary);
|
||||
if (!binary && count < fid->iounit)
|
||||
unflush(1, 0, 0, binary);
|
||||
}
|
||||
if(!binary)
|
||||
unflush(1, 0, 0, binary);
|
||||
ixp_close(fid);
|
||||
|
|
Loading…
Reference in New Issue