summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2022-06-15 10:50:03 +1200
committerRobert Ancell <robert.ancell@canonical.com>2022-06-15 10:50:03 +1200
commit1d1d1e4196b81147cf898ac6dfbe30fcd25d6b2d (patch)
tree2cd868db66429a9926d68d9ca13f6ba19fef5fd1
parent40c3b4d4cfd747707bae1fe3953527dcff650213 (diff)
downloadlightdm-git-1d1d1e4196b81147cf898ac6dfbe30fcd25d6b2d.tar.gz
Fix test against arrays that can never be NULL
-rw-r--r--tests/src/libsystem.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/src/libsystem.c b/tests/src/libsystem.c
index 81d367d9..1c68dc10 100644
--- a/tests/src/libsystem.c
+++ b/tests/src/libsystem.c
@@ -1571,14 +1571,10 @@ pututxline (const struct utmpx *ut)
default:
g_string_append_printf (status, " TYPE=%d", ut->ut_type);
}
- if (ut->ut_line)
- g_string_append_printf (status, " LINE=%s", ut->ut_line);
- if (ut->ut_id)
- g_string_append_printf (status, " ID=%s", ut->ut_id);
- if (ut->ut_user)
- g_string_append_printf (status, " USER=%s", ut->ut_user);
- if (ut->ut_host)
- g_string_append_printf (status, " HOST=%s", ut->ut_host);
+ g_string_append_printf (status, " LINE=%s", ut->ut_line);
+ g_string_append_printf (status, " ID=%s", ut->ut_id);
+ g_string_append_printf (status, " USER=%s", ut->ut_user);
+ g_string_append_printf (status, " HOST=%s", ut->ut_host);
status_notify ("%s", status->str);
}