linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
0031-pax-Use-memcpy-to-set-TMAGIC-and-TVERSION-to-avoid-w.patch
(1150B)
1 From dc49fca08adc0fd8cd9565f2aeca6dc2c8d1fbd2 Mon Sep 17 00:00:00 2001
2 From: Michael Forney <mforney@mforney.org>
3 Date: Thu, 4 Jun 2020 21:44:26 -0700
4 Subject: [PATCH] pax: Use memcpy to set TMAGIC and TVERSION to avoid warning
5
6 ---
7 bin/pax/tar.c | 8 ++++----
8 1 file changed, 4 insertions(+), 4 deletions(-)
9
10 diff --git a/bin/pax/tar.c b/bin/pax/tar.c
11 index a0cbb31b547..095eef85af0 100644
12 --- a/bin/pax/tar.c
13 +++ b/bin/pax/tar.c
14 @@ -1055,8 +1055,8 @@ wr_xheader(ARCHD *arcn, struct xheader *xhdr)
15 memset(hdblk, 0, sizeof(hdblk));
16 hd = (HD_USTAR *)hdblk;
17 hd->typeflag = XHDRTYPE;
18 - strncpy(hd->magic, TMAGIC, TMAGLEN);
19 - strncpy(hd->version, TVERSION, TVERSLEN);
20 + memcpy(hd->magic, TMAGIC, TMAGLEN);
21 + memcpy(hd->version, TVERSION, TVERSLEN);
22 if (ul_oct(size, hd->size, sizeof(hd->size), 3))
23 return -1;
24
25 @@ -1263,8 +1263,8 @@ wr_ustar_or_pax(ARCHD *arcn, int ustar)
26 break;
27 }
28
29 - strncpy(hd->magic, TMAGIC, TMAGLEN);
30 - strncpy(hd->version, TVERSION, TVERSLEN);
31 + memcpy(hd->magic, TMAGIC, TMAGLEN);
32 + memcpy(hd->version, TVERSION, TVERSLEN);
33
34 /*
35 * set the remaining fields. Some versions want all 16 bits of mode
36 --
37 2.49.0
38