[Asterisk-cvs] asterisk-addons mysql-vm-routines.h,1.4,1.5
markster at lists.digium.com
markster at lists.digium.com
Sat May 15 19:06:45 CDT 2004
Update of /usr/cvsroot/asterisk-addons
In directory mongoose.digium.com:/tmp/cvs-serv19745
Modified Files:
mysql-vm-routines.h
Log Message:
MySQL fixes (bug #1638)
Index: mysql-vm-routines.h
===================================================================
RCS file: /usr/cvsroot/asterisk-addons/mysql-vm-routines.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mysql-vm-routines.h 28 Apr 2004 20:47:07 -0000 1.4
+++ mysql-vm-routines.h 15 May 2004 23:18:11 -0000 1.5
@@ -44,8 +44,7 @@
if (retval) {
*retval->mailbox='\0';
- memset(retval->context, 0, sizeof(retval->context));
- strncpy(retval->context, "default", sizeof(retval->context) - 1);
+ *retval->context='\0';
*retval->password='\0';
*retval->fullname='\0';
*retval->email='\0';
@@ -59,12 +58,12 @@
}
if (context) {
strcpy(retval->context, context);
- }
+ }
if (*retval->context) {
sprintf(query, "SELECT password,fullname,email,pager,options FROM users WHERE context='%s' AND mailbox='%s'", context, mailbox);
} else {
- sprintf(query, "SELECT password,fullname,email,pager,options FROM users WHERE mailbox='%s'", mailbox);
+ sprintf(query, "SELECT password,fullname,email,pager,options FROM users WHERE context='default' AND mailbox='%s'", mailbox);
}
ast_mutex_lock(&mysqllock);
mysql_query(dbhandler, query);
More information about the svn-commits
mailing list