Re: [PATCH] reboot: allow to specify reboot mode via sysfs

From: Matteo Croce
Date: Wed Nov 04 2020 - 14:58:19 EST


On Wed, Nov 4, 2020 at 8:42 PM Matteo Croce <mcroce@xxxxxxxxxxxxxxxxxxx> wrote:
> +#ifdef CONFIG_SYSFS
> +
> +#define STARTS_WITH(s, sc) (!strncmp(s, sc, sizeof(sc)))
> +

Just noticed an off-by-one here, it should be sizeof(sc)-1 because of
the null terminator.
This way, the CR usually added by echo will be skipped.

Regards,
--
per aspera ad upstream