An error occurred while fetching folder content.
kobject: Replace strncpy with memcpy
Guenter Roeck authored
commit 77d2a24b

 upstream.

gcc 8.1.0 complains:

lib/kobject.c:128:3: warning:
	'strncpy' output truncated before terminating nul copying as many
	bytes from a string as its length [-Wstringop-truncation]
lib/kobject.c: In function 'kobject_get_path':
lib/kobject.c:125:13: note: length computed here

Using strncpy() is indeed less than perfect since the length of data to
be copied has already been determined with strlen(). Replace strncpy()
with memcpy() to address the warning and optimize the code a little.
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
af882cb0
Name Last commit Last update
..
842 License cleanup: add SPDX GPL-2.0 license identifier to files with no license
fonts License cleanup: add SPDX GPL-2.0 license identifier to files with no license
lz4 lib/lz4: make arrays static const, reduces object code size
lzo License cleanup: add SPDX GPL-2.0 license identifier to files with no license
mpi lib/mpi: Fix umul_ppmm() for MIPS64r6
raid6 lib/raid6: Fix arm64 test build
reed_solomon lib: Remove unnecessary inclusions of asm/semaphore.h
xz lib/xz: enable all filters by default in Kconfig
zlib_deflate zlib_deflate/deftree: remove bi_reverse()
zlib_inflate lib/zlib_inflate/inftrees.c: fix potential buffer overflow
zstd lib: Add zstd modules
.gitignore X.509: Implement simple static OID registry
Kconfig Merge branch 'zstd-minimal' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Kconfig.debug kmemcheck: rip it out
Kconfig.kasan kasan: rework Kconfig settings
Kconfig.kgdb lib: update location of kgdb documentation
Kconfig.ubsan Kconfig: lib/Kconfig.ubsan fix reference to ubsan documentation
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license
argv_split.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license
asn1_decoder.c ASN.1: check for error from ASN1_OP_END__ACT actions
assoc_array.c assoc_array: Fix a buggy node-splitting case
atomic64.c locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
atomic64_test.c lib/atomic64_test.c: add a test that atomic64_inc_not_zero() returns an int
audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license
bcd.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license
bch.c
bitmap.c
bitrev.c
bsearch.c
btree.c
bug.c
build_OID_registry
bust_spinlocks.c
chacha20.c
check_signature.c
checksum.c
clz_ctz.c
clz_tab.c
cmdline.c
compat_audit.c
cordic.c
cpu_rmap.c
cpumask.c
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
crc16.c
crc32.c
crc32defs.h
crc32test.c
crc4.c
crc7.c
crc8.c
ctype.c
debug_info.c
debug_locks.c
debugobjects.c
dec_and_lock.c
decompress.c
decompress_bunzip2.c
decompress_inflate.c
decompress_unlz4.c
decompress_unlzma.c
decompress_unlzo.c
decompress_unxz.c
devres.c
digsig.c
div64.c
dma-debug.c
dma-noop.c
dma-virt.c
dump_stack.c
dynamic_debug.c
dynamic_queue_limits.c
earlycpio.c
errseq.c
extable.c
fault-inject.c
fdt.c
fdt_empty_tree.c
fdt_ro.c
fdt_rw.c
fdt_strerror.c
fdt_sw.c
fdt_wip.c
find_bit.c
flex_array.c
flex_proportions.c
gcd.c
gen_crc32table.c
genalloc.c
glob.c
globtest.c
hexdump.c
hweight.c
idr.c
inflate.c
int_sqrt.c
interval_tree.c
interval_tree_test.c