From dce11f592d17084aa5ba0bd9e33d308291c02921 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Thu, 2 Dec 2010 00:10:42 +0300 Subject: cli: fixed bug of empty username when show sessions invoked with order/match --- accel-pptpd/cli/std_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel-pptpd/cli/std_cmd.c b/accel-pptpd/cli/std_cmd.c index 75ff900d..0d234938 100644 --- a/accel-pptpd/cli/std_cmd.c +++ b/accel-pptpd/cli/std_cmd.c @@ -123,10 +123,10 @@ static int show_ses_exec(const char *cmd, char * const *fields, int fields_cnt, } if (order == ORDER_USERNAME) - row->order_key = _strdup(ppp->username); + row->order_key = ppp->username ? _strdup(ppp->username) : _strdup(""); if (match == MATCH_USERNAME) - row->match_key = _strdup(ppp->username); + row->match_key = ppp->username ? _strdup(ppp->username) : _strdup(""); u_inet_ntoa(ppp->peer_ipaddr, ip_str); -- cgit v1.2.3