]> git.ipfire.org Git - thirdparty/tar.git/commit
maint: avoid -Wstringop-truncation warnings from upcoming GCC8
authorJim Meyering <meyering@fb.com>
Mon, 19 Mar 2018 04:32:19 +0000 (21:32 -0700)
committerSergey Poznyakoff <gray@gnu.org>
Sat, 7 Apr 2018 07:38:31 +0000 (10:38 +0300)
commit0a0242582f134c9994bbad77a57f64d388cf9e19
tree0bd90dfe64cd316cdf7bbd13d29a4994740c5d65
parent2baa531ce53d5876d34f941a97b5041573da453a
maint: avoid -Wstringop-truncation warnings from upcoming GCC8

* src/create.c (start_private_header, start_header): Convert
trivial uses of strncpy to memcpy, to avoid warnings like this:
In function 'strncpy',
    inlined from 'start_private_header' at create.c:522:3:
/usr/include/bits/string_fortified.h:106:10: warning: \
  '__builtin_strncpy' output truncated before terminating nul \
  copying 2 bytes from a string of the same length \
  [-Wstringop-truncation]
src/create.c