600 |
|
{ |
601 |
|
if (pos == bw->fpos) |
602 |
|
return BIR_OK; |
603 |
< |
if (bw->seek == NULL) { |
604 |
< |
if (pos < bw->fpos) |
605 |
< |
return BIR_SEEKERR; |
606 |
< |
while (bw->fpos < pos) |
607 |
< |
wrbyte(0, bw); |
608 |
< |
return BIR_OK; |
609 |
< |
} |
603 |
> |
if (bw->seek == NULL) |
604 |
> |
return BIR_SEEKERR; |
605 |
|
if ((*bw->seek)(pos, bw->c_data) != 0) |
606 |
|
return BIR_SEEKERR; |
607 |
|
bw->fpos = pos; |
756 |
|
bw->yscan++; /* write line break or EOD */ |
757 |
|
if (bw->yscan == bw->hdr->height) { |
758 |
|
wrbyte(0, bw); wrbyte(1, bw); /* end of bitmap marker */ |
759 |
< |
if (bw->seek == NULL || (*bw->seek)(2, bw->c_data) != 0) |
759 |
> |
if (wrseek(2, bw) != BIR_OK) |
760 |
|
return BIR_OK; /* no one may care */ |
761 |
< |
bw->fpos = 2; |
761 |
> |
wrint32(bw->flen, bw); /* correct file length */ |
762 |
> |
if (wrseek(34, bw) != BIR_OK) |
763 |
> |
return BIR_OK; |
764 |
|
wrint32(bw->flen-bw->fbmp, bw); /* correct bitmap length */ |
765 |
|
} else { |
766 |
|
wrbyte(0, bw); wrbyte(0, bw); /* end of line marker */ |