]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
utmp-wtmp: check actual value of bool instead of pointer
authorMike Yuan <me@yhndnzj.com>
Mon, 1 Jan 2024 12:41:18 +0000 (20:41 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 1 Jan 2024 18:13:14 +0000 (19:13 +0100)
src/shared/utmp-wtmp.h

index ec1e27771e9b142b1b113d09e49b0849776689ee..2e04fac404726ef6e048d2da144f74aafea954a4 100644 (file)
@@ -23,7 +23,8 @@ static inline bool utxent_start(void) {
         return true;
 }
 static inline void utxent_cleanup(bool *initialized) {
-        if (initialized)
+        assert(initialized);
+        if (*initialized)
                 endutxent();
 }