lkml.org 
[lkml]   [2020]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] reboot: allow to specify reboot mode via sysfs
On Wed, Nov 4, 2020 at 8:42 PM Matteo Croce <mcroce@linux.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

\
 
 \ /
  Last update: 2020-11-04 20:58    [W:0.142 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site