Forwarded: https://github.com/zchunk/zchunk/pull/46
Last-Update: 2021-08-22
Gbp-Pq: Name cppcheck.patch
VALIDATE_BOOL(zck);
ALLOCD_BOOL(zck, comp);
+#ifndef OLD_ZSTD
size_t retval = 0;
+#endif
comp->cctx = ZSTD_createCCtx();
#ifndef OLD_ZSTD
char *data = zmalloc(BUF_SIZE);
while((read_count = read(zck->temp_fd, data, BUF_SIZE)) > 0) {
- if(read_count == -1 || !write_data(zck, zck->fd, data, read_count)) {
+ if(!write_data(zck, zck->fd, data, read_count)) {
free(data);
return false;
}
}
free(data);
+ if(read_count == -1)
+ return false;
return true;
}
exit(1);
}
zckChunk *chunk1 = zck_get_chunk(zck, 1);
- if(chunk == NULL) {
+ if(chunk1 == NULL) {
printf("%s", zck_get_error(zck));
zck_free(&zck);
exit(1);