aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-27 04:35:18 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-27 04:35:18 +0000
commitc31e55ef75bfe94b6e64db7fa539fcfa6e2e2bf4 (patch)
tree85ca61b2328dbd4a873c27bd7ea95d741006ba20 /apps
parentc2d569ba4c0e2d37964365c11da9d8ba09fd7cde (diff)
Backport revision 43754 from the trunk, which removes an unused buffer from
mm_login to close bug 8038, as well as addresses some formatting and coding guidelines issues in passing. Originally, I did not commit this to 1.4 since it is not necessarily fixing a bug. However, since the IMAP storage code is brand new, I decided it would be better to make the change here as well, in case someone has to work on this code to address issues in the very near future. I don't want to make unnecessary merge problems going to the trunk. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43756 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 29bfbbb0c..5c6a84341 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];
@@ -8177,35 +8177,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);
}