Changeset bad765a in mainline
- Timestamp:
- 2021-11-04T16:29:57Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e3e64f6
- Parents:
- f05f413
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/riff/src/chunk.c
rf05f413 rbad765a 146 146 long pos; 147 147 long cksize; 148 uint8_t pad; 149 size_t nw; 148 150 errno_t rc; 149 151 … … 153 155 154 156 cksize = pos - wchunk->ckstart; 155 if (pos % 2 != 0) 157 if (pos % 2 != 0) { 156 158 ++pos; 159 pad = 0; 160 nw = fwrite(&pad, 1, sizeof(pad), rw->f); 161 if (nw != sizeof(pad)) 162 return EIO; 163 } 157 164 158 165 if (fseek(rw->f, wchunk->ckstart - 4, SEEK_SET) < 0) … … 476 483 uint8_t byte; 477 484 size_t nread; 478 errno_t rc;479 485 480 486 ckend = riff_rchunk_get_ndpos(rchunk); … … 483 489 /* (Buffered) reading is faster than seeking */ 484 490 while (rchunk->riffr->pos < ckend) { 485 rc = riff_read(rchunk, &byte, sizeof(byte), &nread); 486 if (rc != EOK) 487 return rc; 488 491 nread = fread(&byte, 1, sizeof(byte), rchunk->riffr->f); 489 492 if (nread != sizeof(byte)) 490 493 return EIO; 494 495 rchunk->riffr->pos += sizeof(byte); 491 496 } 492 497 … … 495 500 if (fseek(rchunk->riffr->f, ckend, SEEK_SET) < 0) 496 501 return EIO; 502 497 503 rchunk->riffr->pos = ckend; 498 504 }
Note:
See TracChangeset
for help on using the changeset viewer.