diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-01-22 02:18:59 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-01-22 02:19:16 +0100 |
commit | bd40a2d830265cdd36eb19576bdbe8e41dd527ee (patch) | |
tree | 65be055210412b9b3b961a153e7dc131ee7c653e /src/systemctl.c | |
parent | 0b1724894fb85aa1c07b2619e9269cfafd736956 (diff) |
clang: fix some issues found with clang-analyzersystemd/v17
Diffstat (limited to 'src/systemctl.c')
-rw-r--r-- | src/systemctl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/systemctl.c b/src/systemctl.c index fb3430048c..8cdc01aa49 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -502,8 +502,10 @@ static int list_units(DBusConnection *bus, char **args, unsigned n) { c++; } - qsort(unit_infos, c, sizeof(struct unit_info), compare_unit_info); - output_units_list(unit_infos, c); + if (c > 0) { + qsort(unit_infos, c, sizeof(struct unit_info), compare_unit_info); + output_units_list(unit_infos, c); + } r = 0; |