- get_u16 (zr->fr, &time);
- get_u16 (zr->fr, &date);
- get_u32 (zr->fr, &zm->expected_crc);
- get_u32 (zr->fr, &zm->comp_size);
- get_u32 (zr->fr, &zm->ucomp_size);
- get_u16 (zr->fr, &nlen);
- get_u16 (zr->fr, &extralen);
- get_u16 (zr->fr, &clen);
- get_u16 (zr->fr, &diskstart);
- get_u16 (zr->fr, &iattr);
- get_u32 (zr->fr, &eattr);
- get_u32 (zr->fr, &zm->offset);
-
- zm->name = calloc (nlen + 1, 1);
- get_bytes (zr->fr, zm->name, nlen);
+ if (! get_u16 (zr->fr, &time)) return NULL;
+ if (! get_u16 (zr->fr, &date)) return NULL;
+ if (! get_u32 (zr->fr, &zm->expected_crc)) return NULL;
+ if (! get_u32 (zr->fr, &zm->comp_size)) return NULL;
+ if (! get_u32 (zr->fr, &zm->ucomp_size)) return NULL;
+ if (! get_u16 (zr->fr, &nlen)) return NULL;
+ if (! get_u16 (zr->fr, &extralen)) return NULL;
+ if (! get_u16 (zr->fr, &clen)) return NULL;
+ if (! get_u16 (zr->fr, &diskstart)) return NULL;
+ if (! get_u16 (zr->fr, &iattr)) return NULL;
+ if (! get_u32 (zr->fr, &eattr)) return NULL;
+ if (! get_u32 (zr->fr, &zm->offset)) return NULL;
+
+ zm->name = xzalloc (nlen + 1);
+ if (! get_bytes (zr->fr, zm->name, nlen)) return NULL;