Changes in uspace/lib/riff/src/chunk.c [bad765a:20667af] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/riff/src/chunk.c
rbad765a r20667af 146 146 long pos; 147 147 long cksize; 148 uint8_t pad;149 size_t nw;150 148 errno_t rc; 151 149 … … 155 153 156 154 cksize = pos - wchunk->ckstart; 157 if (pos % 2 != 0) {155 if (pos % 2 != 0) 158 156 ++pos; 159 pad = 0;160 nw = fwrite(&pad, 1, sizeof(pad), rw->f);161 if (nw != sizeof(pad))162 return EIO;163 }164 157 165 158 if (fseek(rw->f, wchunk->ckstart - 4, SEEK_SET) < 0) … … 483 476 uint8_t byte; 484 477 size_t nread; 478 errno_t rc; 485 479 486 480 ckend = riff_rchunk_get_ndpos(rchunk); … … 489 483 /* (Buffered) reading is faster than seeking */ 490 484 while (rchunk->riffr->pos < ckend) { 491 nread = fread(&byte, 1, sizeof(byte), rchunk->riffr->f); 485 rc = riff_read(rchunk, &byte, sizeof(byte), &nread); 486 if (rc != EOK) 487 return rc; 488 492 489 if (nread != sizeof(byte)) 493 490 return EIO; 494 495 rchunk->riffr->pos += sizeof(byte);496 491 } 497 492 … … 500 495 if (fseek(rchunk->riffr->f, ckend, SEEK_SET) < 0) 501 496 return EIO; 502 503 497 rchunk->riffr->pos = ckend; 504 498 }
Note:
See TracChangeset
for help on using the changeset viewer.