[Asterisk-cvs] asterisk-addons mysql-vm-routines.h,1.7.2.2,1.7.2.3

russell at lists.digium.com russell at lists.digium.com
Thu Feb 10 23:29:28 CST 2005


Update of /usr/cvsroot/asterisk-addons
In directory mongoose.digium.com:/tmp/cvs-serv3660

Modified Files:
      Tag: v1-0
	mysql-vm-routines.h 
Log Message:
oops ...


Index: mysql-vm-routines.h
===================================================================
RCS file: /usr/cvsroot/asterisk-addons/Attic/mysql-vm-routines.h,v
retrieving revision 1.7.2.2
retrieving revision 1.7.2.3
diff -u -d -r1.7.2.2 -r1.7.2.3
--- mysql-vm-routines.h	7 Feb 2005 04:47:36 -0000	1.7.2.2
+++ mysql-vm-routines.h	11 Feb 2005 05:29:33 -0000	1.7.2.3
@@ -60,7 +60,7 @@
 
 		/* We should at this point have the context and retval->context else we free retval and return NULL */
 		if (*retval->context) {
-			snprintf(query, sizeof(query-1), "SELECT password,fullname,email,pager,options FROM users WHERE context='%s' AND mailbox='%s'", context, mailbox);
+			snprintf(query, sizeof(query)-1, "SELECT password,fullname,email,pager,options FROM users WHERE context='%s' AND mailbox='%s'", context, mailbox);
 		} else {
 			free(retval);
 			return(NULL);
@@ -107,11 +107,11 @@
 	char query[400];
 
 	if (*vmu->context) {
-		snprintf(query, sizeof(query-1), "UPDATE users SET password='%s' WHERE context='%s' AND mailbox='%s' AND password='%s'", password, vmu->context, vmu->mailbox, vmu->password);
+		snprintf(query, sizeof(query)-1, "UPDATE users SET password='%s' WHERE context='%s' AND mailbox='%s' AND password='%s'", password, vmu->context, vmu->mailbox, vmu->password);
 	} else {
 		/* Lets be specific here since we can have for example exten 123 in diffrent contexts.
 		   This has the ability to update/change passwords for all users with mailbox 123. */
-		snprintf(query, sizeof(query-1), "UPDATE users SET password='%s' WHERE mailbox='%s' AND password='%s' AND context='default'", password, vmu->mailbox, vmu->password);
+		snprintf(query, sizeof(query)-1, "UPDATE users SET password='%s' WHERE mailbox='%s' AND password='%s' AND context='default'", password, vmu->mailbox, vmu->password);
 	}
 	ast_mutex_lock(&mysqllock);
 	mysql_query(dbhandler, query);
@@ -124,11 +124,11 @@
 	char query[320];
 
 	if (context) {
-		snprintf(query, sizeof(query-1), "UPDATE users SET password='%s' WHERE context='%s' AND mailbox='%s'", password, context, mailbox);
+		snprintf(query, sizeof(query)-1, "UPDATE users SET password='%s' WHERE context='%s' AND mailbox='%s'", password, context, mailbox);
 	} else {
 		/* Lets be specific here since we can have for example exten 123 in diffrent contexts.
 		   This has the ability to reset passwords for all users with mailbox 123. */
-		snprintf(query, sizeof(query-1), "UPDATE users SET password='%s' WHERE mailbox='%s' AND context='default'", password, mailbox);
+		snprintf(query, sizeof(query)-1, "UPDATE users SET password='%s' WHERE mailbox='%s' AND context='default'", password, mailbox);
 	}
 	ast_mutex_lock(&mysqllock);
 	mysql_query(dbhandler, query);




More information about the svn-commits mailing list