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

Yuxuan Shui yshuiv7 at gmail.com
Thu Dec 5 06:30:04 PST 2013


---
 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;
 
         return 1;
-- 
1.8.4.2



More information about the systemd-devel mailing list