m68k: mm: Replace strcpy() with strscpy() in hardware_proc_show()
PATCH 1/1 m68k: mm: Replace strcpy() with strscpy() in hardware_proc_show()
strcpy() is deprecated; use strscpy() instead.
--- arch/m68k/kernel/setup_mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/kernel/setup_mm.c +1 -1
@@ -484,7 +484,7 @@ static int hardware_proc_show(struct seq_file *m, void *v)if (mach_get_model)mach_get_model (model);else -strcpy (model,"Unknown m68k" ); +strscpy (model,"Unknown m68k" );seq_printf (m,"Model:\t\t%s\n" , model);for (mem =0 , i =0 ; i < m68k_num_memory; i++)
Signature · 1 line
2.49.0
Hi Thorsten,
Quoted 14 lines · Thorsten Blum
strcpy()is deprecated; usestrscpy()instead.Signed-off-by Thorsten Blum <[email protected]>--- arch/m68k/kernel/setup_mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/m68k/kernel/setup_mm.c +0
-0
arch/m68k/kernel/setup_mm.c static int hardware_proc_show(struct seq_file *m, void *v) · line 490
Quoted 8 lines
arch/m68k/kernel/setup_mm.c +1
-1@@ -484,7 +484,7 @@ static int hardware_proc_show(struct seq_file *m, void *v)if (mach_get_model)mach_get_model (model);else -strcpy (model,"Unknown m68k" ); +strscpy (model,"Unknown m68k" );seq_printf (m,"Model:\t\t%s\n" , model);for (mem =0 , i =0 ; i < m68k_num_memory; i++)
As we are not using the return value, I think it is a safe replacement.
Jean-Michel,
Am 22.04.2025 um 01:02 schrieb Jean-Michel Hautbois:
Quoted 3 lines
As we are not using the return value, I think it is a safe replacement.
Signed-off-by Jean-Michel Hautbois <[email protected]>
Would not 'Reviewed-by' be more appropriate here?
Cheers,
Michael
Hi Michael,
Quoted 10 lines · Michael Schmitz
Jean-Michel,
Am 22.04.2025 um 01:02 schrieb Jean-Michel Hautbois:
Quoted 3 lines
As we are not using the return value, I think it is a safe replacement.
Signed-off-by Jean-Michel Hautbois <[email protected]>Would not 'Reviewed-by' be more appropriate here?
Oh my, indeed, not enough sleeping lately :-/ !
JM
Hi Jean-Michel,
Quoted 21 lines · Jean-Michel Hautbois
Quoted 20 lines · Thorsten Blum
strcpy()is deprecated; usestrscpy()instead.Signed-off-by Thorsten Blum <[email protected]>--- arch/m68k/kernel/setup_mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/m68k/kernel/setup_mm.c +1
-1@@ -484,7 +484,7 @@ static int hardware_proc_show(struct seq_file *m, void *v)if (mach_get_model)mach_get_model (model);else -strcpy (model,"Unknown m68k" ); +strscpy (model,"Unknown m68k" );
Quoted 4 lines
arch/m68k/kernel/setup_mm.c static int hardware_proc_show(struct seq_file *m, void *v) · line 490
Quoted 2 lines
arch/m68k/kernel/setup_mm.c +0
-0seq_printf (m,"Model:\t\t%s\n" , model);for (mem =0 , i =0 ; i < m68k_num_memory; i++)As we are not using the return value, I think it is a safe replacement.
strcpy() and strscpy() not only differ in return value: the (optional) third parameter of strscpy() specifies the destination buffer size. When not passed, the size is taken from the actual destination buffer.
i.e. will queue in the m68k tree for v6.16.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds