Minor fixes.

This commit is contained in:
Con Kolivas 2010-11-02 00:08:35 +11:00
parent 772fbf602e
commit 1e88273ffc
2 changed files with 5 additions and 4 deletions

View file

@ -179,7 +179,7 @@ static i64 runzip_chunk(int fd_in, int fd_out, int fd_hist, i64 expected_size, i
if (ofs == -1)
fatal("Failed to seek input file in runzip_fd\n");
if (fstat(fd_in, &st) != 0 || st.st_size-ofs == 0)
if (fstat(fd_in, &st) != 0 || st.st_size - ofs == 0)
return 0;
ss = open_stream_in(fd_in, NUM_STREAMS);

View file

@ -831,10 +831,11 @@ static int fill_buffer(struct stream_info *sinfo, int stream)
sinfo->total_read += header_length;
if (sinfo->s[stream].buf)
free(sinfo->s[stream].buf);
sinfo->s[stream].buf = malloc(u_len);
sinfo->s[stream].buf = realloc(sinfo->s[stream].buf, u_len);
else
sinfo->s[stream].buf = malloc(u_len);
if (!sinfo->s[stream].buf)
return -1;
fatal("Unable to malloc buffer of size %lld in fill_buffer\n", u_len);
if (read_buf(sinfo->fd, sinfo->s[stream].buf, c_len) != 0)
return -1;