summaryrefslogtreecommitdiff
path: root/accel-pppd/cli
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2011-01-13 19:52:15 +0300
committerDmitry Kozlov <xeb@mail.ru>2011-01-13 19:52:15 +0300
commit472a769d098dbf81644fe76de2885c53839f9071 (patch)
treed23ead9c38675ac4601b13a41c27350df79aa3f3 /accel-pppd/cli
parent1e997d3ea80accb91a5f955637de4b09e8e496f8 (diff)
downloadaccel-ppp-472a769d098dbf81644fe76de2885c53839f9071.tar.gz
accel-ppp-472a769d098dbf81644fe76de2885c53839f9071.zip
cli: show sessions: initialize buffer to zero if username is still empty
Diffstat (limited to 'accel-pppd/cli')
-rw-r--r--accel-pppd/cli/show_sessions.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c
index 90aeb3fc..555fa885 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)