gpiolib: replace snprintf("%s") with strscpy
PATCH 1/1 gpiolib: replace snprintf("%s") with strscpy
Replace snprintf("%s", ...) with strscpy() for direct string copying.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/gpio/gpiolib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.h +2 -1
@@ -17,6 +17,7 @@#include <linux/module.h> #include <linux/notifier.h> #include <linux/spinlock.h> +#include <linux/string.h> #include <linux/srcu.h> #include <linux/workqueue.h>
@@ -107,7 +108,7 @@ extern const char *const gpio_suffixes[];if (con_id) \snprintf (propname,sizeof (propname),"%s-%s" , con_id, __gs); \else \ -snprintf (propname,sizeof (propname),"%s" , __gs); \ +strscpy (propname, __gs); \1 ; \ }); \ __suffixes++)
Signature · 2 lines
Thorsten Blum <[email protected]> GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
Bartosz Golaszewski
AppliedQuoted 3 lines · Thorsten Blum
Replace
snprintf("%s", ...)withstrscpy()for direct string copying.
Applied, thanks!
[1/1] gpiolib: replace snprintf("%s") with strscpy
https://git.kernel.org/brgl/c/e8fc8588d06cf46cd7df622886e5a4be57442b65
Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>