ext/libmspack/mspack/cabd.c in libmspack-0.0.4 vs ext/libmspack/mspack/cabd.c in libmspack-0.0.5

- old
+ new

@@ -72,12 +72,11 @@ struct mscab_decompressor *base, struct mscabd_cabinet *origcab); static int cabd_read_headers( struct mspack_system *sys, struct mspack_file *fh, struct mscabd_cabinet_p *cab, off_t offset, int quiet); static char *cabd_read_string( - struct mspack_system *sys, struct mspack_file *fh, - struct mscabd_cabinet_p *cab, int *error); + struct mspack_system *sys, struct mspack_file *fh, int *error); static struct mscabd_cabinet *cabd_search( struct mscab_decompressor *base, const char *filename); static int cabd_find( struct mscab_decompressor_p *self, unsigned char *buf, @@ -389,18 +388,18 @@ cab->block_resv = 0; } /* read name and info of preceeding cabinet in set, if present */ if (cab->base.flags & cfheadPREV_CABINET) { - cab->base.prevname = cabd_read_string(sys, fh, cab, &x); if (x) return x; - cab->base.previnfo = cabd_read_string(sys, fh, cab, &x); if (x) return x; + cab->base.prevname = cabd_read_string(sys, fh, &x); if (x) return x; + cab->base.previnfo = cabd_read_string(sys, fh, &x); if (x) return x; } /* read name and info of next cabinet in set, if present */ if (cab->base.flags & cfheadNEXT_CABINET) { - cab->base.nextname = cabd_read_string(sys, fh, cab, &x); if (x) return x; - cab->base.nextinfo = cabd_read_string(sys, fh, cab, &x); if (x) return x; + cab->base.nextname = cabd_read_string(sys, fh, &x); if (x) return x; + cab->base.nextinfo = cabd_read_string(sys, fh, &x); if (x) return x; } /* read folders */ for (i = 0; i < num_folders; i++) { if (sys->read(fh, &buf[0], cffold_SIZEOF) != cffold_SIZEOF) { @@ -500,11 +499,11 @@ file->date_d = x & 0x1F; file->date_m = (x >> 5) & 0xF; file->date_y = (x >> 9) + 1980; /* get filename */ - file->filename = cabd_read_string(sys, fh, cab, &x); + file->filename = cabd_read_string(sys, fh, &x); if (x) { sys->free(file); return x; } @@ -516,12 +515,11 @@ return MSPACK_ERR_OK; } static char *cabd_read_string(struct mspack_system *sys, - struct mspack_file *fh, - struct mscabd_cabinet_p *cab, int *error) + struct mspack_file *fh, int *error) { off_t base = sys->tell(fh); char buf[256], *str; unsigned int len, i, ok; @@ -1262,10 +1260,11 @@ } /* blocks must not be over CAB_INPUTMAX in size */ len = EndGetI16(&hdr[cfdata_CompressedSize]); if (((d->i_end - d->i_ptr) + len) > CAB_INPUTMAX) { - D(("block size > CAB_INPUTMAX (%ld + %d)", d->i_end - d->i_ptr, len)) + D(("block size > CAB_INPUTMAX (%ld + %d)", + (long)(d->i_end - d->i_ptr), len)) return MSPACK_ERR_DATAFORMAT; } /* blocks must not expand to more than CAB_BLOCKMAX */ if (EndGetI16(&hdr[cfdata_UncompressedSize]) > CAB_BLOCKMAX) {