use switch_snprintf instead of snprintf becuase in insures null termination of strings.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6707 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2007-12-12 21:53:32 +00:00
1 parent 44636d333f
commit 54ec86f6ce
49 files changed
+306 -306

No files matched your search

@@ -359,7 +359,7 @@ static JSBool odbc_get_data(JSContext * cx, JSObject * obj, uintN argc, jsval *a
SQLLEN m = 0;
char code[66560];
snprintf(code, sizeof(code), "~var _oDbC_dB_RoW_DaTa_ = {}");
switch_snprintf(code, sizeof(code), "~var _oDbC_dB_RoW_DaTa_ = {}");
eval_some_js(code, cx, obj, rval);
if (*rval == JS_FALSE) {
return JS_TRUE;
@@ -383,7 +383,7 @@ static JSBool odbc_get_data(JSContext * cx, JSObject * obj, uintN argc, jsval *a
data = esc;
}
snprintf((char *) odbc_obj->code, odbc_obj->codelen, "~_oDbC_dB_RoW_DaTa_[\"%s\"] = \"%s\"", name, data);
switch_snprintf((char *) odbc_obj->code, odbc_obj->codelen, "~_oDbC_dB_RoW_DaTa_[\"%s\"] = \"%s\"", name, data);
switch_safe_free(esc);
eval_some_js((char *) odbc_obj->code, cx, obj, rval);