aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-18 16:32:37 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-18 16:32:37 +0000
commit57bccad15550c7de36dddd30d308aebd35d70ff2 (patch)
treebb400accdba263130451404b8e32fa73dc859a60 /apps/app_voicemail.c
parent938caded5d2221f5f6fa76ac7f6a3d99e725ccc1 (diff)
Merged revisions 28212 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r28212 | file | 2006-05-18 13:31:16 -0300 (Thu, 18 May 2006) | 2 lines Return -1 on error in ODBC messagecount and 0 on success (issue #7133 reported by cfieldmtm) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@28213 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a306f9d60..66094b2bd 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2014,7 +2014,7 @@ static const char *mbox(int id)
#ifdef USE_ODBC_STORAGE
static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
{
- int x = 0;
+ int x = -1;
int res;
SQLHSTMT stmt;
char sql[256];
@@ -2027,6 +2027,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
*newmsgs = 0;
if (oldmsgs)
*oldmsgs = 0;
+
/* If no mailbox, return immediately */
if (ast_strlen_zero(mailbox))
return 0;
@@ -2118,7 +2119,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
odbc_release_obj(obj);
*oldmsgs = atoi(rowdata);
- x = 1;
+ x = 0;
} else
ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);