summaryrefslogtreecommitdiff
path: root/archivers/libarchive/files/contrib/untar.c
diff options
context:
space:
mode:
Diffstat (limited to 'archivers/libarchive/files/contrib/untar.c')
-rw-r--r--archivers/libarchive/files/contrib/untar.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/archivers/libarchive/files/contrib/untar.c b/archivers/libarchive/files/contrib/untar.c
index dc092d325e0..c4cc2bf9bea 100644
--- a/archivers/libarchive/files/contrib/untar.c
+++ b/archivers/libarchive/files/contrib/untar.c
@@ -38,7 +38,7 @@ parseoct(const char *p, size_t n)
{
int i = 0;
- while (*p < '0' || *p > '7') {
+ while ((*p < '0' || *p > '7') && n > 0) {
++p;
--n;
}
@@ -140,7 +140,7 @@ untar(FILE *a, const char *path)
if (bytes_read < 512) {
fprintf(stderr,
"Short read on %s: expected 512, got %d\n",
- path, bytes_read);
+ path, (int)bytes_read);
return;
}
if (is_end_of_archive(buff)) {
@@ -183,7 +183,7 @@ untar(FILE *a, const char *path)
if (bytes_read < 512) {
fprintf(stderr,
"Short read on %s: Expected 512, got %d\n",
- path, bytes_read);
+ path, (int)bytes_read);
return;
}
if (filesize < 512)