[asterisk-commits] twilson: branch twilson/res_config_sqlite3 r334416 - /team/twilson/res_config...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Sep 3 00:32:02 CDT 2011
Author: twilson
Date: Sat Sep 3 00:31:51 2011
New Revision: 334416
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=334416
Log:
Address some of tilghman's review comments
Modified:
team/twilson/res_config_sqlite3/res/res_config_sqlite3.c
Modified: team/twilson/res_config_sqlite3/res/res_config_sqlite3.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/res_config_sqlite3/res/res_config_sqlite3.c?view=diff&rev=334416&r1=334415&r2=334416
==============================================================================
--- team/twilson/res_config_sqlite3/res/res_config_sqlite3.c (original)
+++ team/twilson/res_config_sqlite3/res/res_config_sqlite3.c Sat Sep 3 00:31:51 2011
@@ -46,6 +46,7 @@
#include "asterisk/astobj2.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
+#include "asterisk/app.h"
/*** DOCUMENTATION
***/
@@ -298,7 +299,7 @@
} else if (!strcasecmp(var->name, "requirements")) {
db->requirements = str_to_requirements(var->value);
} else if (!strcasecmp(var->name, "batch")) {
- db->batch = atoi(var->value);
+ ast_app_parse_timelen(var->value, (int *) &db->batch, TIMELEN_MILLISECONDS);
} else if (!strcasecmp(var->name, "debug")) {
db->debug = ast_true(var->value);
}
@@ -567,10 +568,10 @@
while ((param = va_arg(ap, const char *)) && (value = va_arg(ap, const char *))) {
if (first) {
- ast_str_set(&sql, 0, "SELECT * FROM %s WHERE %s%s \"%s\"", table, param, strchr(param, ' ') ? "" : " =", value);
+ ast_str_set(&sql, 0, "SELECT * FROM %s WHERE %s%s '%s'", table, param, strchr(param, ' ') ? "" : " =", value);
first = 0;
} else {
- ast_str_append(&sql, 0, " AND %s%s \"%s\"", param, strchr(param, ' ') ? "" : " =", value);
+ ast_str_append(&sql, 0, " AND %s%s '%s'", param, strchr(param, ' ') ? "" : " =", value);
}
}
@@ -771,10 +772,10 @@
while ((param = va_arg(ap, const char *)) && (value = va_arg(ap, const char *))) {
if (tmp) {
- ast_str_set(&sql, 0, "DELETE FROM %s WHERE %s%s \"%s\"", table, param, strchr(param, ' ') ? "" : " =", value);
+ ast_str_set(&sql, 0, "DELETE FROM %s WHERE %s%s '%s'", table, param, strchr(param, ' ') ? "" : " =", value);
tmp = 0;
} else {
- ast_str_append(&sql, 0, " AND %s%s \"%s\"", param, strchr(param, ' ') ? "" : " =", value);
+ ast_str_append(&sql, 0, " AND %s%s '%s'", param, strchr(param, ' ') ? "" : " =", value);
}
}
More information about the asterisk-commits
mailing list