logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.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. bin/pax/tar.c | 8 ++++----
  7. 1 file changed, 4 insertions(+), 4 deletions(-)
  8. diff --git a/bin/pax/tar.c b/bin/pax/tar.c
  9. index a0cbb31b547..095eef85af0 100644
  10. --- a/bin/pax/tar.c
  11. +++ b/bin/pax/tar.c
  12. @@ -1055,8 +1055,8 @@ wr_xheader(ARCHD *arcn, struct xheader *xhdr)
  13. memset(hdblk, 0, sizeof(hdblk));
  14. hd = (HD_USTAR *)hdblk;
  15. hd->typeflag = XHDRTYPE;
  16. - strncpy(hd->magic, TMAGIC, TMAGLEN);
  17. - strncpy(hd->version, TVERSION, TVERSLEN);
  18. + memcpy(hd->magic, TMAGIC, TMAGLEN);
  19. + memcpy(hd->version, TVERSION, TVERSLEN);
  20. if (ul_oct(size, hd->size, sizeof(hd->size), 3))
  21. return -1;
  22. @@ -1263,8 +1263,8 @@ wr_ustar_or_pax(ARCHD *arcn, int ustar)
  23. break;
  24. }
  25. - strncpy(hd->magic, TMAGIC, TMAGLEN);
  26. - strncpy(hd->version, TVERSION, TVERSLEN);
  27. + memcpy(hd->magic, TMAGIC, TMAGLEN);
  28. + memcpy(hd->version, TVERSION, TVERSLEN);
  29. /*
  30. * set the remaining fields. Some versions want all 16 bits of mode
  31. --
  32. 2.49.0