- size_t volume_label_max_len =
- (sizeof current_header->header.name
- - 1 /* for trailing '\0' */
- - (multi_volume_option
- ? (sizeof " Volume "
- - 1 /* for null at end of " Volume " */
- + INT_STRLEN_BOUND (int) /* for volume number */
- - 1 /* for sign, as 0 <= volno */)
- : 0));
- if (volume_label_max_len < strlen (volume_label_option))
- USAGE_ERROR ((0, 0,
- ngettext ("%s: Volume label is too long (limit is %lu byte)",
- "%s: Volume label is too long (limit is %lu bytes)",
- volume_label_max_len),
- quotearg_colon (volume_label_option),
- (unsigned long) volume_label_max_len));
+ if (archive_format == GNU_FORMAT || archive_format == OLDGNU_FORMAT)
+ {
+ size_t volume_label_max_len =
+ (sizeof current_header->header.name
+ - 1 /* for trailing '\0' */
+ - (multi_volume_option
+ ? (sizeof " Volume "
+ - 1 /* for null at end of " Volume " */
+ + INT_STRLEN_BOUND (int) /* for volume number */
+ - 1 /* for sign, as 0 <= volno */)
+ : 0));
+ if (volume_label_max_len < strlen (volume_label_option))
+ USAGE_ERROR ((0, 0,
+ ngettext ("%s: Volume label is too long (limit is %lu byte)",
+ "%s: Volume label is too long (limit is %lu bytes)",
+ volume_label_max_len),
+ quotearg_colon (volume_label_option),
+ (unsigned long) volume_label_max_len));
+ }
+ /* else FIXME
+ Label length in PAX format is limited by the volume size. */