reboot: Replace strncmp with str_has_prefix
PATCH 9/12 reboot: Replace strncmp with str_has_prefix
strncmp(str, const, len) is error-prone.
We had better use newly introducedstr_has_prefix() instead of it.
Signed-off-by Chuhong Yuan <[email protected]>
--- kernel/reboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/reboot.c +1 -1
@@ -530,7 +530,7 @@ static int __init reboot_setup(char *str)*/ reboot_default =0 ; -if (!strncmp (str,"panic_" ,6 )) { +if (str_has_prefix (str,"panic_" )) { mode = &panic_reboot_mode; str +=6 ; }else {
Signature · 1 line
2.20.1