diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-18 16:31:16 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-18 16:31:16 +0000 |
commit | d7badb16c77504daaa0faecfa6c9374281a974ca (patch) | |
tree | 6f9c8ddd78488e7dbc0e22c29a3cf80fc53bf16c /apps | |
parent | dbdb7501e3cf718e95adf781ce63463f3cf74a6e (diff) |
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/branches/1.2@28212 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_voicemail.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 35eedeca6..214c7aff3 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2006,7 +2006,7 @@ static 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]; @@ -2018,6 +2018,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; @@ -2099,7 +2100,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs) } SQLFreeHandle (SQL_HANDLE_STMT, stmt); *oldmsgs = atoi(rowdata); - x = 1; + x = 0; } else ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database); |