[asterisk-addons-commits] tilghman: branch tilghman/realtime_update2 r676 - /team/tilghman/realtime_upd...

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Mon Oct 13 14:15:28 CDT 2008


Author: tilghman
Date: Mon Oct 13 14:15:28 2008
New Revision: 676

URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=676
Log:
Fixing problems found during testing

Modified:
    team/tilghman/realtime_update2/res/res_config_mysql.c

Modified: team/tilghman/realtime_update2/res/res_config_mysql.c
URL: http://svn.digium.com/view/asterisk-addons/team/tilghman/realtime_update2/res/res_config_mysql.c?view=diff&rev=676&r1=675&r2=676
==============================================================================
--- team/tilghman/realtime_update2/res/res_config_mysql.c (original)
+++ team/tilghman/realtime_update2/res/res_config_mysql.c Mon Oct 13 14:15:28 2008
@@ -615,7 +615,7 @@
 	my_ulonglong numrows;
 	int first = 1;
 	const char *newparam, *newval;
-	struct ast_str *sql = ast_str_thread_get(&sql_buf, 100), *buf = ast_str_thread_get(&sql_buf, 100);
+	struct ast_str *sql = ast_str_thread_get(&sql_buf, 100), *buf = ast_str_thread_get(&escapebuf_buf, 100);
 	struct ast_str *where = ast_str_thread_get(&where_buf, 100);
 	struct tables *table;
 	struct columns *column = NULL;
@@ -658,6 +658,7 @@
 		}
 		ESCAPE_STRING(buf, newval);
 		ast_str_append(&where, 0, "%s %s='%s'", first ? "" : " AND", newparam, buf->str);
+		first = 0;
 
 		/* If the column length isn't long enough, give a chance to lengthen it. */
 		if (strncmp(column->type, "char", 4) == 0 || strncmp(column->type, "varchar", 7) == 0) {
@@ -684,7 +685,7 @@
 
 		/* If the column length isn't long enough, give a chance to lengthen it. */
 		if (strncmp(column->type, "char", 4) == 0 || strncmp(column->type, "varchar", 7) == 0) {
-			internal_require(database, tablename, newparam, RQ_CHAR, buf->used);
+			internal_require(database, tablename, newparam, RQ_CHAR, strlen(newval));
 		}
 	}
 	va_end(ap);




More information about the asterisk-addons-commits mailing list