[svn-commits] mmichelson: branch 12 r413398 - in /branches/12: ./ res/res_config_odbc.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 7 12:50:57 CDT 2014


Author: mmichelson
Date: Wed May  7 12:50:52 2014
New Revision: 413398

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=413398
Log:
Fix encoding of custom prepare extra data.

Patches:
	res_config_odbc-take2.patch by John Hardin (License #6512)
........

Merged revisions 413396 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413397 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/12/   (props changed)
    branches/12/res/res_config_odbc.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/res/res_config_odbc.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_config_odbc.c?view=diff&rev=413398&r1=413397&r2=413398
==============================================================================
--- branches/12/res/res_config_odbc.c (original)
+++ branches/12/res/res_config_odbc.c Wed May  7 12:50:52 2014
@@ -135,13 +135,13 @@
 	}
 
 	if (!ast_strlen_zero(cps->extra)) {
-		if (strchr(cps->extra, ';') || strchr(cps->extra, '^')) {
-			ENCODE_CHUNK(encodebuf, cps->extra);
-			SQLBindParameter(stmt, x++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(encodebuf), 0, (void *)encodebuf, 0, NULL);
+		const char *newval = cps->extra;
+		if (strchr(newval, ';') || strchr(newval, '^')) {
+			ENCODE_CHUNK(encodebuf, newval);
+			ast_string_field_set(cps, encoding[x], encodebuf);
+			newval = cps->encoding[x];
 		} 
-		else {
-			SQLBindParameter(stmt, x++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(cps->extra), 0, (void *)cps->extra, 0, NULL);
-		}
+		SQLBindParameter(stmt, x++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(newval), 0, (void *)newval, 0, NULL);
 	}
 
 	return stmt;




More information about the svn-commits mailing list