Merge pull request #2915 from stoeckmann/err_style

libarchive: Improve error message style
(cherry picked from commit be30e16fea)
This commit is contained in:
Tim Kientzle authored and Martin Matuska committed 2026-04-13 08:38:47 +02:00
1 parent 34b19b772b
commit 38e0db1561
22 files changed
+85 -85

No files matched your search

+1 -1
View File
@@ -155,7 +155,7 @@ __archive_check_magic(struct archive *a, unsigned int magic,
if (a->magic != magic) {
archive_set_error(a, -1,
"PROGRAMMER ERROR: Function '%s' invoked"
" on '%s' archive object, which is not supported.",
" on '%s' archive object, which is not supported",
function,
handle_type);
a->state = ARCHIVE_STATE_FATAL;
+5 -5
View File
@@ -379,7 +379,7 @@ archive_read_set_callback_data2(struct archive *_a, void *client_data,
if (a->client.dataset == NULL)
{
archive_set_error(&a->archive, ENOMEM,
"No memory.");
"No memory");
return ARCHIVE_FATAL;
}
a->client.nodes = 1;
@@ -388,7 +388,7 @@ archive_read_set_callback_data2(struct archive *_a, void *client_data,
if (iindex > a->client.nodes - 1)
{
archive_set_error(&a->archive, EINVAL,
"Invalid index specified.");
"Invalid index specified");
return ARCHIVE_FATAL;
}
a->client.dataset[iindex].data = client_data;
@@ -409,14 +409,14 @@ archive_read_add_callback_data(struct archive *_a, void *client_data,
"archive_read_add_callback_data");
if (iindex > a->client.nodes) {
archive_set_error(&a->archive, EINVAL,
"Invalid index specified.");
"Invalid index specified");
return ARCHIVE_FATAL;
}
p = realloc(a->client.dataset, sizeof(*a->client.dataset)
* (++(a->client.nodes)));
if (p == NULL) {
archive_set_error(&a->archive, ENOMEM,
"No memory.");
"No memory");
return ARCHIVE_FATAL;
}
a->client.dataset = (struct archive_read_data_node *)p;
@@ -625,7 +625,7 @@ _archive_read_next_header2(struct archive *_a, struct archive_entry *entry)
r1 = archive_read_data_skip(&a->archive);
if (r1 == ARCHIVE_EOF)
archive_set_error(&a->archive, EIO,
"Premature end-of-file.");
"Premature end-of-file");
if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
a->archive.state = ARCHIVE_STATE_FATAL;
return (ARCHIVE_FATAL);
+3 -3
View File
@@ -921,7 +921,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_path_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
@@ -1035,7 +1035,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_time_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
@@ -1061,7 +1061,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_owner_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
+3 -3
View File
@@ -947,7 +947,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_path_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
@@ -1019,7 +1019,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_time_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
@@ -1045,7 +1045,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
r = archive_match_owner_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
"Failed : %s", archive_error_string(a->matching));
"%s", archive_error_string(a->matching));
return (r);
}
if (r) {
@@ -975,7 +975,7 @@ archive_read_format_7zip_read_header(struct archive_read *a,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Pathname cannot be converted "
"from %s to current locale.",
"from %s to current locale",
archive_string_conversion_charset_name(zip->sconv));
ret = ARCHIVE_WARN;
}
+3 -3
View File
@@ -980,7 +980,7 @@ archive_read_format_cab_read_header(struct archive_read *a,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Pathname cannot be converted "
"from %s to current locale.",
"from %s to current locale",
archive_string_conversion_charset_name(sconv));
err = ARCHIVE_WARN;
}
@@ -1026,7 +1026,7 @@ archive_read_format_cab_read_data(struct archive_read *a,
*offset = 0;
archive_clear_error(&a->archive);
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Cannot restore this file split in multivolume.");
"Cannot restore this file split in multivolume");
return (ARCHIVE_FAILED);
default:
break;
@@ -1672,7 +1672,7 @@ cab_read_ahead_cfdata_lzx(struct archive_read *a, ssize_t *avail)
cab->entry_cffolder->compdata);
if (r != ARCHIVE_OK) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Can't initialize LZX decompression.");
"Can't initialize LZX decompression");
*avail = ARCHIVE_FATAL;
return (NULL);
}
@@ -397,7 +397,7 @@ archive_read_format_cpio_read_header(struct archive_read *a,
return (ARCHIVE_FATAL);
}
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Pathname can't be converted from %s to current locale.",
"Pathname can't be converted from %s to current locale",
archive_string_conversion_charset_name(sconv));
r = ARCHIVE_WARN;
}
@@ -426,7 +426,7 @@ archive_read_format_cpio_read_header(struct archive_read *a,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Linkname can't be converted from %s to "
"current locale.",
"current locale",
archive_string_conversion_charset_name(sconv));
r = ARCHIVE_WARN;
}
@@ -1322,7 +1322,7 @@ archive_read_format_iso9660_read_header(struct archive_read *a,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Pathname cannot be converted "
"from %s to current locale.",
"from %s to current locale",
archive_string_conversion_charset_name(
iso9660->sconv_utf16be));
@@ -1400,7 +1400,7 @@ archive_read_format_iso9660_read_header(struct archive_read *a,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Linkname cannot be converted "
"from %s to current locale.",
"from %s to current locale",
archive_string_conversion_charset_name(
iso9660->sconv_utf16be));
rd_r = ARCHIVE_WARN;
@@ -1728,7 +1728,7 @@ zisofs_read_data(struct archive_read *a,
(void)size;/* UNUSED */
(void)offset;/* UNUSED */
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"zisofs is not supported on this platform.");
"zisofs is not supported on this platform");
return (ARCHIVE_FAILED);
}
+2 -2
View File
@@ -613,7 +613,7 @@ archive_read_format_lha_read_header(struct archive_read *a,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Pathname cannot be converted "
"from %s to Unicode.",
"from %s to Unicode",
archive_string_conversion_charset_name(lha->sconv_dir));
err = ARCHIVE_FATAL;
} else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
@@ -634,7 +634,7 @@ archive_read_format_lha_read_header(struct archive_read *a,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Pathname cannot be converted "
"from %s to Unicode.",
"from %s to Unicode",
archive_string_conversion_charset_name(lha->sconv_fname));
err = ARCHIVE_FATAL;
}
+29 -29
View File
@@ -955,7 +955,7 @@ archive_read_format_rar_read_header(struct archive_read *a,
if ((h = __archive_read_ahead(a, 7, NULL)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Failed to read next header.");
"Failed to read next header");
return (ARCHIVE_FATAL);
}
p = h;
@@ -1005,7 +1005,7 @@ archive_read_format_rar_read_header(struct archive_read *a,
archive_entry_set_is_data_encrypted(entry, 1);
rar->has_encrypted_entries = 1;
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"RAR encryption support unavailable.");
"RAR encryption support unavailable");
return (ARCHIVE_FATAL);
}
@@ -1141,7 +1141,7 @@ archive_read_format_rar_read_data(struct archive_read *a, const void **buff,
default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Unsupported compression method for RAR file.");
"Unsupported compression method for RAR file");
ret = ARCHIVE_FATAL;
break;
}
@@ -1432,14 +1432,14 @@ read_header(struct archive_read *a, struct archive_entry *entry,
else
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"RAR solid archive support unavailable.");
"RAR solid archive support unavailable");
return (ARCHIVE_FATAL);
}
if ((h = __archive_read_ahead(a, (size_t)header_size - 7, NULL)) == NULL)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Failed to read full header content.");
"Failed to read full header content");
return (ARCHIVE_FATAL);
}
@@ -1471,7 +1471,7 @@ read_header(struct archive_read *a, struct archive_entry *entry,
archive_entry_set_is_data_encrypted(entry, 1);
rar->has_encrypted_entries = 1;
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"RAR encryption support unavailable.");
"RAR encryption support unavailable");
/* Since it is only the data part itself that is encrypted we can at least
extract information about the currently processed entry and don't need
to return ARCHIVE_FATAL here. */
@@ -1503,7 +1503,7 @@ read_header(struct archive_read *a, struct archive_entry *entry,
if (rar->packed_size < 0 || rar->unp_size < 0)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Invalid sizes specified.");
"Invalid sizes specified");
return (ARCHIVE_FATAL);
}
@@ -1516,19 +1516,19 @@ read_header(struct archive_read *a, struct archive_entry *entry,
size_t distance = p - (const char *)h;
if (rar->packed_size > INT64_MAX - header_size) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Extended header size too large.");
"Extended header size too large");
return (ARCHIVE_FATAL);
}
header_size += rar->packed_size;
if ((uintmax_t)header_size > SIZE_MAX) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Unable to read extended header data.");
"Unable to read extended header data");
return (ARCHIVE_FATAL);
}
/* Make sure we have the extended data. */
if ((h = __archive_read_ahead(a, (size_t)header_size - 7, NULL)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Failed to read extended header data.");
"Failed to read extended header data");
return (ARCHIVE_FATAL);
}
p = h;
@@ -1547,7 +1547,7 @@ read_header(struct archive_read *a, struct archive_entry *entry,
newptr = realloc(rar->filename, newsize);
if (newptr == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Couldn't allocate memory.");
"Couldn't allocate memory");
return (ARCHIVE_FATAL);
}
rar->filename = newptr;
@@ -1701,7 +1701,7 @@ read_header(struct archive_read *a, struct archive_entry *entry,
newsize = sizeof(*rar->dbo) * (rar->nodes + 1);
if ((newdbo = realloc(rar->dbo, newsize)) == NULL)
{
archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory.");
archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory");
return (ARCHIVE_FATAL);
}
rar->dbo = newdbo;
@@ -1715,7 +1715,7 @@ read_header(struct archive_read *a, struct archive_entry *entry,
if (rar->packed_size > INT64_MAX - a->filter->position)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Unable to store offsets.");
"Unable to store offsets");
return (ARCHIVE_FATAL);
}
rar->dbo[rar->cursor].start_offset = a->filter->position;
@@ -1734,7 +1734,7 @@ read_header(struct archive_read *a, struct archive_entry *entry,
newsize = filename_size + 1;
if ((newptr = realloc(rar->filename_save, newsize)) == NULL)
{
archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory.");
archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory");
return (ARCHIVE_FATAL);
}
rar->filename_save = newptr;
@@ -1745,7 +1745,7 @@ read_header(struct archive_read *a, struct archive_entry *entry,
free(rar->dbo);
if ((rar->dbo = calloc(1, sizeof(*rar->dbo))) == NULL)
{
archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory.");
archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory");
return (ARCHIVE_FATAL);
}
rar->dbo[0].header_size = header_size;
@@ -1776,7 +1776,7 @@ read_header(struct archive_read *a, struct archive_entry *entry,
__archive_read_consume(a, header_size - 7);
if (rar->packed_size > INT64_MAX - a->filter->position) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Unable to store offsets.");
"Unable to store offsets");
return (ARCHIVE_FATAL);
}
rar->dbo[0].start_offset = a->filter->position;
@@ -1848,7 +1848,7 @@ read_header(struct archive_read *a, struct archive_entry *entry,
return (ARCHIVE_FATAL);
}
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Pathname cannot be converted from %s to current locale.",
"Pathname cannot be converted from %s to current locale",
archive_string_conversion_charset_name(fn_sconv));
ret = (ARCHIVE_WARN);
}
@@ -1979,13 +1979,13 @@ read_symlink_stored(struct archive_read *a, struct archive_entry *entry,
if ((uintmax_t)rar->packed_size > SIZE_MAX)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Unable to read link.");
"Unable to read link");
return (ARCHIVE_FATAL);
}
if ((h = rar_read_ahead(a, (size_t)rar->packed_size, NULL)) == NULL)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Failed to read link.");
"Failed to read link");
return (ARCHIVE_FATAL);
}
p = h;
@@ -2000,7 +2000,7 @@ read_symlink_stored(struct archive_read *a, struct archive_entry *entry,
return (ARCHIVE_FATAL);
}
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"link cannot be converted from %s to current locale.",
"link cannot be converted from %s to current locale",
archive_string_conversion_charset_name(sconv));
ret = (ARCHIVE_WARN);
}
@@ -2201,7 +2201,7 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size,
case 3:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Parsing filters is unsupported.");
"Parsing filters is unsupported");
return (ARCHIVE_FAILED);
case 4:
@@ -2473,7 +2473,7 @@ parse_codes(struct archive_read *a)
free(precode.tree);
free(precode.table);
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Internal error extracting RAR file.");
"Internal error extracting RAR file");
return (ARCHIVE_FATAL);
}
@@ -2562,13 +2562,13 @@ parse_codes(struct archive_read *a)
new_size = rar_fls((unsigned int)rar->unp_size) << 1;
if (new_size == 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Zero window size is invalid.");
"Zero window size is invalid");
return (ARCHIVE_FATAL);
}
new_window = realloc(rar->lzss.window, new_size);
if (new_window == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Unable to allocate memory for uncompressed data.");
"Unable to allocate memory for uncompressed data");
return (ARCHIVE_FATAL);
}
rar->lzss.window = (unsigned char *)new_window;
@@ -2686,7 +2686,7 @@ create_code(struct archive_read *a, struct huffman_code *code,
code->numallocatedentries = 0;
if (new_node(code) < 0) {
archive_set_error(&a->archive, ENOMEM,
"Unable to allocate memory for node data.");
"Unable to allocate memory for node data");
return (ARCHIVE_FATAL);
}
code->numentries = 1;
@@ -2794,7 +2794,7 @@ add_value(struct archive_read *a, struct huffman_code *code, int value,
{
if (new_node(code) < 0) {
archive_set_error(&a->archive, ENOMEM,
"Unable to allocate memory for node data.");
"Unable to allocate memory for node data");
return (ARCHIVE_FATAL);
}
code->tree[lastnode].branches[bit] = code->numentries++;
@@ -2863,13 +2863,13 @@ make_table_recurse(struct archive_read *a, struct huffman_code *code, int node,
if (!code->tree)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Huffman tree was not created.");
"Huffman tree was not created");
return (ARCHIVE_FATAL);
}
if (node < 0 || node >= code->numentries)
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Invalid location to Huffman tree specified.");
"Invalid location to Huffman tree specified");
return (ARCHIVE_FATAL);
}
@@ -3180,7 +3180,7 @@ copy_from_lzss_window_to_unp(struct archive_read *a, const void **buffer,
if ((rar->unp_buffer = malloc(rar->unp_buffer_size)) == NULL)
{
archive_set_error(&a->archive, ENOMEM,
"Unable to allocate memory for uncompressed data.");
"Unable to allocate memory for uncompressed data");
return (ARCHIVE_FATAL);
}
}
@@ -675,7 +675,7 @@ static int run_filter(struct archive_read* a, struct filter_info* flt) {
rar->cstate.filtered_buf = malloc(flt->block_length);
if(!rar->cstate.filtered_buf) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate memory for filter data.");
"Can't allocate memory for filter data");
return ARCHIVE_FATAL;
}
@@ -1851,7 +1851,7 @@ static int process_head_file(struct archive_read* a, struct rar5* rar,
rar->cstate.window_buf == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Declared solid file, but no window buffer "
"initialized yet.");
"initialized yet");
return ARCHIVE_FATAL;
}
@@ -1861,7 +1861,7 @@ static int process_head_file(struct archive_read* a, struct rar5* rar,
(rar->file.dir == 0 && window_size == 0))
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Declared dictionary size is not supported.");
"Declared dictionary size is not supported");
return ARCHIVE_FATAL;
}
@@ -1873,7 +1873,7 @@ static int process_head_file(struct archive_read* a, struct rar5* rar,
{
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Window size for this solid file doesn't match "
"the window size used in previous solid file. ");
"the window size used in previous solid file");
return ARCHIVE_FATAL;
}
}
@@ -1899,7 +1899,7 @@ static int process_head_file(struct archive_read* a, struct rar5* rar,
if(!new_window_buf) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
"Not enough memory when trying to realloc the window "
"buffer.");
"buffer");
return ARCHIVE_FATAL;
}
@@ -3057,7 +3057,7 @@ static int parse_filter(struct archive_read* ar, const uint8_t* p) {
filt = add_new_filter(rar);
if(filt == NULL) {
archive_set_error(&ar->archive, ENOMEM,
"Can't allocate memory for a filter descriptor.");
"Can't allocate memory for a filter descriptor");
return ARCHIVE_FATAL;
}
@@ -3506,7 +3506,7 @@ static int merge_block(struct archive_read* a, ssize_t block_size,
rar->vol.push_buf = malloc(block_size + 8);
if(!rar->vol.push_buf) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate memory for a merge block buffer.");
"Can't allocate memory for a merge block buffer");
return ARCHIVE_FATAL;
}
@@ -3539,7 +3539,7 @@ static int merge_block(struct archive_read* a, ssize_t block_size,
if(partial_offset + cur_block_size > block_size) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_PROGRAMMER,
"Consumed too much data when merging blocks.");
"Consumed too much data when merging blocks");
return ARCHIVE_FATAL;
}
+1 -1
View File
@@ -1202,7 +1202,7 @@ set_conversion_failed_error(struct archive_read *a,
return (ARCHIVE_FATAL);
}
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"%s can't be converted from %s to current locale.",
"%s can't be converted from %s to current locale",
name, archive_string_conversion_charset_name(sconv));
return (ARCHIVE_WARN);
}
+6 -6
View File
@@ -733,7 +733,7 @@ xar_read_header(struct archive_read *a, struct archive_entry *entry)
}
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Gname cannot be converted from %s to current locale.",
"Gname cannot be converted from %s to current locale",
archive_string_conversion_charset_name(xar->sconv));
r = ARCHIVE_WARN;
}
@@ -748,7 +748,7 @@ xar_read_header(struct archive_read *a, struct archive_entry *entry)
}
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Uname cannot be converted from %s to current locale.",
"Uname cannot be converted from %s to current locale",
archive_string_conversion_charset_name(xar->sconv));
r = ARCHIVE_WARN;
}
@@ -762,7 +762,7 @@ xar_read_header(struct archive_read *a, struct archive_entry *entry)
}
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Pathname cannot be converted from %s to current locale.",
"Pathname cannot be converted from %s to current locale",
archive_string_conversion_charset_name(xar->sconv));
r = ARCHIVE_WARN;
}
@@ -778,7 +778,7 @@ xar_read_header(struct archive_read *a, struct archive_entry *entry)
}
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Linkname cannot be converted from %s to current locale.",
"Linkname cannot be converted from %s to current locale",
archive_string_conversion_charset_name(xar->sconv));
r = ARCHIVE_WARN;
}
@@ -1008,7 +1008,7 @@ move_reading_point(struct archive_read *a, uint64_t offset)
if (pos == ARCHIVE_FAILED) {
archive_set_error(&(a->archive),
ARCHIVE_ERRNO_MISC,
"Cannot seek.");
"Cannot seek");
return (ARCHIVE_FAILED);
}
xar->offset = pos;
@@ -1476,7 +1476,7 @@ decompression_init(struct archive_read *a, enum enctype encoding)
r = inflateInit(&(xar->stream));
if (r != Z_OK) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Couldn't initialize zlib stream.");
"Couldn't initialize zlib stream");
return (ARCHIVE_FATAL);
}
xar->stream_valid = 1;
+2 -2
View File
@@ -1008,7 +1008,7 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Pathname cannot be converted "
"from %s to current locale.",
"from %s to current locale",
archive_string_conversion_charset_name(sconv));
ret = ARCHIVE_WARN;
}
@@ -1256,7 +1256,7 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry,
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Symlink cannot be converted "
"from %s to current locale.",
"from %s to current locale",
archive_string_conversion_charset_name(
sconv));
ret = ARCHIVE_WARN;
+1 -1
View File
@@ -1713,7 +1713,7 @@ get_sconv_object(struct archive *a, const char *fc, const char *tc, int flag)
if (a != NULL) {
#if HAVE_ICONV
archive_set_error(a, ARCHIVE_ERRNO_MISC,
"iconv_open failed : Cannot handle ``%s''",
"iconv_open failed: Cannot handle ``%s''",
(flag & SCONV_TO_CHARSET)?tc:fc);
#else
archive_set_error(a, ARCHIVE_ERRNO_MISC,
+1 -1
View File
@@ -1516,7 +1516,7 @@ restore_entry(struct archive_write_disk *a)
if ((en == ENOENT) && (archive_entry_hardlink(a->entry) != NULL)) {
archive_set_error(&a->archive, en,
"Hard-link target '%s' does not exist.",
"Hard-link target '%s' does not exist",
archive_entry_hardlink(a->entry));
return (ARCHIVE_FAILED);
}
@@ -506,12 +506,12 @@ write_header(struct archive_write *a, struct archive_entry *entry)
if ((a->archive.archive_format == ARCHIVE_FORMAT_CPIO_PWB) &&
(archive_entry_size(entry) > 256*256*256-1)) {
archive_set_error(&a->archive, ERANGE,
"File is too large for PWB binary cpio format.");
"File is too large for PWB binary cpio format");
ret_final = ARCHIVE_FAILED;
goto exit_write_header;
} else if (archive_entry_size(entry) > INT32_MAX) {
archive_set_error(&a->archive, ERANGE,
"File is too large for binary cpio format.");
"File is too large for binary cpio format");
ret_final = ARCHIVE_FAILED;
goto exit_write_header;
}
@@ -322,7 +322,7 @@ write_header(struct archive_write *a, struct archive_entry *entry)
h + c_filesize_offset, c_filesize_size);
if (ret) {
archive_set_error(&a->archive, ERANGE,
"File is too large for this format.");
"File is too large for this format");
ret_final = ARCHIVE_FAILED;
goto exit_write_header;
}
@@ -380,7 +380,7 @@ write_header(struct archive_write *a, struct archive_entry *entry)
h + c_filesize_offset, c_filesize_size);
if (ret) {
archive_set_error(&a->archive, ERANGE,
"File is too large for cpio format.");
"File is too large for cpio format");
ret_final = ARCHIVE_FAILED;
goto exit_write_header;
}
@@ -1381,7 +1381,7 @@ iso9660_options(struct archive_write *a, const char *key, const char *value)
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Option ``%s'' "
"is not supported on this platform.", key);
"is not supported on this platform", key);
return (ARCHIVE_FATAL);
#endif
}
@@ -1503,7 +1503,7 @@ iso9660_options(struct archive_write *a, const char *key, const char *value)
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"``zisofs'' "
"is not supported on this platform.");
"is not supported on this platform");
return (ARCHIVE_FATAL);
#endif
}
@@ -1539,7 +1539,7 @@ iso9660_write_header(struct archive_write *a, struct archive_entry *entry)
if (archive_entry_filetype(entry) == AE_IFLNK
&& iso9660->opt.rr == OPT_RR_DISABLED) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Ignore symlink file.");
"Ignore symlink file");
iso9660->cur_file = NULL;
return (ARCHIVE_WARN);
}
@@ -1549,7 +1549,7 @@ iso9660_write_header(struct archive_write *a, struct archive_entry *entry)
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Ignore over %lld bytes file. "
"This file too large.",
"This file too large",
MULTI_EXTENT_SIZE);
iso9660->cur_file = NULL;
return (ARCHIVE_WARN);
@@ -2103,7 +2103,7 @@ iso9660_close(struct archive_write *a)
if (iso9660->directories_too_deep != NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"%s: Directories too deep.",
"%s: Directories too deep",
archive_entry_pathname(
iso9660->directories_too_deep->file->entry));
return (ARCHIVE_WARN);
@@ -3799,7 +3799,7 @@ set_file_identifier(unsigned char *bp, int from, int to, enum vdc vdc,
isoent = isoent_find_entry(vdd->rootent, ids);
if (isoent == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Not Found %s `%s'.",
"Not Found %s `%s'",
label, ids);
return (ARCHIVE_FATAL);
}
@@ -7080,7 +7080,7 @@ isoent_make_path_table(struct archive_write *a)
* See also ISO9660 Standard 9.4.
*/
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Too many directories(%d) over 65535.", dir_number);
"Too many directories(%d) over 65535", dir_number);
return (ARCHIVE_FATAL);
}
@@ -7203,7 +7203,7 @@ isoent_create_boot_catalog(struct archive_write *a, struct isoent *rootent)
else {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Boot image file(``%s'') size is too big "
"for fd type.",
"for fd type",
iso9660->el_torito.boot_filename.s);
return (ARCHIVE_FATAL);
}
+1 -1
View File
@@ -2262,7 +2262,7 @@ mtree_entry_exchange_same_entry(struct archive_write *a, struct mtree_entry *np,
if ((np->mode & AE_IFMT) != (file->mode & AE_IFMT)) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Found duplicate entries for `%s' with "
"differing file types.",
"differing file types",
np->pathname.s);
return (ARCHIVE_FAILED);
}
+1 -1
View File
@@ -1471,7 +1471,7 @@ archive_write_pax_header(struct archive_write *a,
if (r < ARCHIVE_WARN) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"archive_write_pax_header: "
"'x' header failed?! This can't happen.\n");
"'x' header failed?! This can't happen");
archive_entry_free(entry_main);
archive_string_free(&entry_name);
return (ARCHIVE_FATAL);