util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] lslogins: fix assertion failure for none existing logins
@ 2014-12-08 22:20 Sami Kerola
  2014-12-08 22:20 ` [PATCH 2/2] lslogins: align usage() and manual with struct option longopts Sami Kerola
  2014-12-09  8:23 ` [PATCH 1/2] lslogins: fix assertion failure for none existing logins Karel Zak
  0 siblings, 2 replies; 3+ messages in thread
From: Sami Kerola @ 2014-12-08 22:20 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

This cange makes the following to retun none-zero value instead of a core
dump.

$ lslogins qwertyuiopasdfghjklzxcvbnm1234567
lslogins: libsmartcols/src/line.c:362: scols_line_get_cell: Assertion `ln' failed.
Aborted (core dumped)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 login-utils/lslogins.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index 7867404..38d3cf6 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -842,7 +842,7 @@ static int get_user(struct lslogins_control *ctl, struct lslogins_user **user,
 		    const char *username)
 {
 	*user = get_user_info(ctl, username);
-	if (!*user && errno)
+	if (!*user)
 		if (IS_REAL_ERRNO(errno))
 			return -1;
 	return 0;
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-09  8:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 22:20 [PATCH 1/2] lslogins: fix assertion failure for none existing logins Sami Kerola
2014-12-08 22:20 ` [PATCH 2/2] lslogins: align usage() and manual with struct option longopts Sami Kerola
2014-12-09  8:23 ` [PATCH 1/2] lslogins: fix assertion failure for none existing logins Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).