vty: Address coverity issue with subscr->name never being NULL

Coverity points out that subscr->name is an array and never NULL.
Use strlen instead in this check.

Fixes: Coverity CID 1040717
This commit is contained in:
Holger Hans Peter Freyther 2013-12-12 15:45:41 +01:00
parent 3d5290b136
commit 7d552fc8da
1 changed files with 1 additions and 1 deletions

View File

@ -873,7 +873,7 @@ static void subscr_dump_vty(struct vty *vty, struct gsm_subscriber *subscr)
{
vty_out(vty, " ID: %llu, Authorized: %d%s", subscr->id,
subscr->authorized, VTY_NEWLINE);
if (subscr->name)
if (strlen(subscr->name))
vty_out(vty, " Name: '%s'%s", subscr->name, VTY_NEWLINE);
if (subscr->extension)
vty_out(vty, " Extension: %s%s", subscr->extension,