mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
usb: gadget: functionfs: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Ai Chao <aichao@kylinos.cn> Link: https://patch.msgid.link/20260310094434.3639602-4-aichao@kylinos.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
786bf7ef56
commit
224fb8661f
|
|
@ -1541,9 +1541,9 @@ static int f_midi2_create_card(struct f_midi2 *midi2)
|
|||
return err;
|
||||
midi2->card = card;
|
||||
|
||||
strcpy(card->driver, "f_midi2");
|
||||
strcpy(card->shortname, "MIDI 2.0 Gadget");
|
||||
strcpy(card->longname, "MIDI 2.0 Gadget");
|
||||
strscpy(card->driver, "f_midi2");
|
||||
strscpy(card->shortname, "MIDI 2.0 Gadget");
|
||||
strscpy(card->longname, "MIDI 2.0 Gadget");
|
||||
|
||||
id = 0;
|
||||
for (i = 0; i < midi2->num_eps; i++) {
|
||||
|
|
|
|||
|
|
@ -1086,7 +1086,7 @@ static int gs_console_init(struct gs_port *port)
|
|||
if (!cons)
|
||||
return -ENOMEM;
|
||||
|
||||
strcpy(cons->console.name, "ttyGS");
|
||||
strscpy(cons->console.name, "ttyGS");
|
||||
cons->console.write = gs_console_write;
|
||||
cons->console.device = gs_console_device;
|
||||
cons->console.flags = CON_PRINTBUFFER;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user