Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/riff/src/chunk.c

    rbad765a r20667af  
    146146        long pos;
    147147        long cksize;
    148         uint8_t pad;
    149         size_t nw;
    150148        errno_t rc;
    151149
     
    155153
    156154        cksize = pos - wchunk->ckstart;
    157         if (pos % 2 != 0) {
     155        if (pos % 2 != 0)
    158156                ++pos;
    159                 pad = 0;
    160                 nw = fwrite(&pad, 1, sizeof(pad), rw->f);
    161                 if (nw != sizeof(pad))
    162                         return EIO;
    163         }
    164157
    165158        if (fseek(rw->f, wchunk->ckstart - 4, SEEK_SET) < 0)
     
    483476        uint8_t byte;
    484477        size_t nread;
     478        errno_t rc;
    485479
    486480        ckend = riff_rchunk_get_ndpos(rchunk);
     
    489483                /* (Buffered) reading is faster than seeking */
    490484                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
    492489                        if (nread != sizeof(byte))
    493490                                return EIO;
    494 
    495                         rchunk->riffr->pos += sizeof(byte);
    496491                }
    497492
     
    500495                if (fseek(rchunk->riffr->f, ckend, SEEK_SET) < 0)
    501496                        return EIO;
    502 
    503497                rchunk->riffr->pos = ckend;
    504498        }
Note: See TracChangeset for help on using the changeset viewer.