/* Use uname if it's present, else lookup name from uid. */
uname = archive_entry_uname(entry);
if (uname == NULL)
- uname = lookup_uname(cpio, archive_entry_uid(entry));
+ uname = lookup_uname(cpio, (uid_t)archive_entry_uid(entry));
/* Use gname if it's present, else lookup name from gid. */
gname = archive_entry_gname(entry);
if (gname == NULL)
- gname = lookup_gname(cpio, archive_entry_gid(entry));
+ gname = lookup_gname(cpio, (uid_t)archive_entry_gid(entry));
}
/* Print device number or file size. */
free(buff);
return;
}
- for (j = 0; j < datasize; ++j) {
+ for (j = 0; j < (int)datasize; ++j) {
data[j] = (char)(rand() % 256);
}
failure(path);
/* Edit that file with a lot more data and update the archive with a new copy. */
buff = malloc(buff_size);
assert(buff != NULL);
- for (i = 0; i < buff_size; ++i)
+ for (i = 0; i < (int)buff_size; ++i)
buff[i] = "abcdefghijklmnopqrstuvwxyz"[rand() % 26];
buff[buff_size - 1] = '\0';
assertMakeFile("f1", 0644, buff);
/* Choose a suitable copy buffer size */
bsdtar->buff_size = 64 * 1024;
- while (bsdtar->buff_size < bsdtar->bytes_per_block)
+ while (bsdtar->buff_size < (size_t)bsdtar->bytes_per_block)
bsdtar->buff_size *= 2;
/* Try to compensate for space we'll lose to alignment. */
bsdtar->buff_size += 16 * 1024;