batman-adv: Replace usage of strlcpy with strscpy
authorSven Eckelmann <sven@narfation.org>
Sat, 6 Jul 2019 12:56:13 +0000 (14:56 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Mon, 22 Jul 2019 19:34:14 +0000 (21:34 +0200)
commit529a8f939a5fdbfa27d10bba728d9764212ab26f
tree44af2af3f7e71b6d00fb4fc775121c40bc334b38
parentbc986391c80decf6b5a16756f29400377833b1e9
batman-adv: Replace usage of strlcpy with strscpy

The strscpy was introduced to fix some API problems around strlcpy. And
checkpatch started to report recently that strlcpy is deprecated and
strscpy is preferred.

The functionality introduced in commit 30035e45753b ("string: provide
strscpy()") improves following points compared to strlcpy:

* it doesn't read from memory beyond (src + size)
* provides an easy way to check for destination buffer overflow
* robust against asynchronous source buffer changes

Since batman-adv doesn't depend on any of the previously mentioned behavior
changes, the usage of strlcpy can simply be replaced by strscpy to silence
checkpatch.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/soft-interface.c
net/batman-adv/sysfs.c