[asterisk-commits] branch 1.2 r28212 - /branches/1.2/apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu May 18 09:31:16 MST 2006


Author: file
Date: Thu May 18 11:31:16 2006
New Revision: 28212

URL: http://svn.digium.com/view/asterisk?rev=28212&view=rev
Log:
Return -1 on error in ODBC messagecount and 0 on success (issue #7133 reported by cfieldmtm)

Modified:
    branches/1.2/apps/app_voicemail.c

Modified: branches/1.2/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_voicemail.c?rev=28212&r1=28211&r2=28212&view=diff
==============================================================================
--- branches/1.2/apps/app_voicemail.c (original)
+++ branches/1.2/apps/app_voicemail.c Thu May 18 11:31:16 2006
@@ -2006,7 +2006,7 @@
 #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 @@
                 *newmsgs = 0;
         if (oldmsgs)
                 *oldmsgs = 0;
+
         /* If no mailbox, return immediately */
         if (ast_strlen_zero(mailbox))
                 return 0;
@@ -2099,7 +2100,7 @@
 		}
 		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);
 		



More information about the asterisk-commits mailing list