diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-27 04:28:37 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-27 04:28:37 +0000 |
commit | 7c564986b98910b7f07d6a0f9525e6c375fcdf52 (patch) | |
tree | 274cb4d714ecbd4e89fd558c06a7cbce6f799155 /apps | |
parent | 52da543985c8469e7a2e00413686a6a478dfd63a (diff) |
remote an unused buffer in mm_login() (issue #8038, selsky)
In passing, I have cleaned up some formatting to better comply with our
guidelines. I have also changed one place to use S_OR(), and a couple of
places to use ast_strlen_zero() as appropriate.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43754 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_voicemail.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index c8098b96e..93ed2bd71 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -90,8 +90,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #ifdef IMAP_STORAGE AST_MUTEX_DEFINE_STATIC(curhstusr_lock); -static char *curhst = NIL; /* currently connected host */ -static char *curusr = NIL; /* current login user */ +static char *curhst = NULL; /* currently connected host */ +static char *curusr = NULL; /* current login user */ static char temp[1024]; @@ -8172,35 +8172,25 @@ void mm_log(char *string, long errflg) void mm_dlog(char *string) { - ast_log (LOG_NOTICE,string); + ast_log(LOG_NOTICE,string); } void mm_login(NETMBX * mb, char *user, char *pwd, long trial) { - char tmp[MAILTMPLEN]; - if(option_debug > 3) + if (option_debug > 3) ast_log(LOG_DEBUG, "Entering callback mm_login\n"); ast_mutex_lock(&curhstusr_lock); if (curhst) - fs_give ((void **) &curhst); - curhst = (char *) fs_get (1 + strlen (mb->host)); - strcpy (curhst, mb->host); - if (*mb->user) { - strcpy (user, mb->user); - sprintf (tmp, "{%s/%s/user=\"%s\"} password: ", mb->host, mb->service, mb->user); - } else { - /* strcpy (tmp, "Password for jar: ");*/ - strcpy(user,curusr); - } - if (curusr) - fs_give ((void **) &curusr); + fs_give((void **) &curhst); + curhst = (char *) fs_get(1 + strlen(mb->host)); + strcpy(curhst, mb->host); + strcpy(user, S_OR(mb->user, curusr)); + fs_give((void **) &curusr); ast_mutex_unlock(&curhstusr_lock); - /* strcpy (pwd, getpass (tmp));*/ /* We should only do this when necessary */ - if (strlen(authpassword) > 0) { - strcpy (pwd, authpassword); - } + if (!ast_strlen_zero(authpassword)) + strcpy(pwd, authpassword); } |