[systemd-devel] [PATCH] util: fix misuse of memcmp

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu Dec 5 22:02:01 PST 2013


On Thu, Dec 05, 2013 at 10:30:04PM +0800, Yuxuan Shui wrote:
> ---
>  src/shared/util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/shared/util.c b/src/shared/util.c
> index b4ed2c4..d685966 100644
> --- a/src/shared/util.c
> +++ b/src/shared/util.c
> @@ -5919,7 +5919,7 @@ int shall_restore_state(void) {
>                  return 1;
>  
>          FOREACH_WORD_QUOTED(w, l, line, state)
> -                if (l == 23 && memcmp(w, "systemd.restore_state=0", 23))
> +                if (l == 23 && memcmp(w, "systemd.restore_state=0", 23) == 0)
>                          return 0;
Applied, with memcmp changed to strneq.

Zbyszek


More information about the systemd-devel mailing list