From 80d9af42aadd7fde2a4e25a499b6949cef40d496 Mon Sep 17 00:00:00 2001 From: KokaKiwi Date: Thu, 16 Jan 2014 03:00:32 +0100 Subject: [PATCH] Test if there are users before printing them. --- users/users.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/users/users.rs b/users/users.rs index b8c28eb68..496db81b9 100644 --- a/users/users.rs +++ b/users/users.rs @@ -139,6 +139,8 @@ fn exec(filename: &str) { endutent(); } - users.sort(); - println!("{}", users.connect(" ")); + if users.len() > 0 { + users.sort(); + println!("{}", users.connect(" ")); + } }