]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Minor changes.
authorSamanta Navarro <ferivoz@riseup.net>
Tue, 1 Jun 2021 15:38:21 +0000 (18:38 +0300)
committerSergey Poznyakoff <gray@gnu.org>
Tue, 1 Jun 2021 15:49:28 +0000 (18:49 +0300)
* src/xheader.c (decode_record): Fix format specification.
(xattr_encode_keyword): Allocate space for terminating \0.

src/xheader.c

index e773a95154633afc517b1679ab1888307cd91cc7..4f8b2b27cc62c9985bd3c437599e0afb8670dfc5 100644 (file)
@@ -708,7 +708,7 @@ decode_record (struct xheader *xhdr,
   if (len_max < len)
     {
       int len_len = len_lim - p;
-      ERROR ((0, 0, _("Extended header length %*s is out of range"),
+      ERROR ((0, 0, _("Extended header length %.*s is out of range"),
              len_len, p));
       return false;
     }
@@ -919,7 +919,7 @@ xattr_encode_keyword(const char *keyword)
     {
       char c = *keyword;
 
-      if (bp + 2 /* enough for URL encoding also.. */ >= encode_buffer_size)
+      if (bp + 3 /* enough for URL encoding also.. */ >= encode_buffer_size)
         {
           encode_buffer = x2realloc (encode_buffer, &encode_buffer_size);
         }