projects/linux·commit 505ffcc8

affs: move from strlcpy with unused retval to strscpy

505ffcc8 · Wolfram Sang <[email protected]> · 2022-08-18 23:01:39 +02:00

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Commit
505ffcc852401aaac4dfb57c16bec0f7838c0e00
Parents
5abbb7b9

Changes

1 files changed · +1 −1

FileStatusAddDelContent
fs/affs/super.cmodified+1−1View file

fs/affs/super.c

View file
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 4c5f30a..58b3914 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -276,7 +276,7 @@ parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved,
char *vol = match_strdup(&args[0]);
if (!vol)
return 0;
- strlcpy(volume, vol, 32);
+ strscpy(volume, vol, 32);
kfree(vol);
break;
}