From 472a769d098dbf81644fe76de2885c53839f9071 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Thu, 13 Jan 2011 19:52:15 +0300 Subject: cli: show sessions: initialize buffer to zero if username is still empty --- accel-pppd/cli/show_sessions.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'accel-pppd/cli') diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c index 90aeb3f..555fa88 100644 --- a/accel-pppd/cli/show_sessions.c +++ b/accel-pppd/cli/show_sessions.c @@ -344,13 +344,13 @@ static void print_username(const struct ppp_t *ppp, char *buf) { if (ppp->username) snprintf(buf, CELL_SIZE, "%s", ppp->username); + else + *buf = 0; } static void print_ip(const struct ppp_t *ppp, char *buf) { - char str[17]; - u_inet_ntoa(ppp->peer_ipaddr, str); - sprintf(buf, "%s", str); + u_inet_ntoa(ppp->peer_ipaddr, buf); } static void print_type(const struct ppp_t *ppp, char *buf) -- cgit v1.2.3