[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFnufp3GFaQ2qJE2kwXHUqyTd1NZhkvAdcbr+D2kqsv=Vs=Xww@mail.gmail.com>
Date: Wed, 4 Nov 2020 20:57:39 +0100
From: Matteo Croce <mcroce@...ux.microsoft.com>
To: linux-kernel@...r.kernel.org
Cc: Mike Rapoport <rppt@...nel.org>,
Guenter Roeck <linux@...ck-us.net>,
Arnd Bergmann <arnd@...db.de>, Petr Mladek <pmladek@...e.com>,
Pavel Tatashin <pasha.tatashin@...een.com>,
Kees Cook <keescook@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] reboot: allow to specify reboot mode via sysfs
On Wed, Nov 4, 2020 at 8:42 PM Matteo Croce <mcroce@...ux.microsoft.com> 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
Powered by blists - more mailing lists