diff options
author | Richard Mudgett <rmudgett@digium.com> | 2012-05-31 18:39:30 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2012-05-31 18:39:30 +0000 |
commit | dd2427c1414d62cd7e3c867f17de9d6dbac844fe (patch) | |
tree | 5760fb673e236d0f58b094240de81ca9780cd135 /res/res_config_odbc.c | |
parent | fdb002a43a819542693815767a0ca9aba135f18c (diff) |
Coverity Report: Fix issues for error type REVERSE_INULL (core modules)
* Fixes findings: 0-2,5,7-15,24-26,28-31
(issue ASTERISK-19648)
Reported by: Matt Jordan
........
Merged revisions 368039 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 368042 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_config_odbc.c')
-rw-r--r-- | res/res_config_odbc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c index 30dfc5cdf..46922835f 100644 --- a/res/res_config_odbc.c +++ b/res/res_config_odbc.c @@ -317,7 +317,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char * char sql[1024]; char coltitle[256]; char rowdata[2048]; - const char *initfield=NULL; + const char *initfield; char *op; const char *newparam; char *stringp; @@ -375,9 +375,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char * } va_end(aq); - if (initfield) { - snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ORDER BY %s", initfield); - } + snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ORDER BY %s", initfield); va_copy(cps.ap, ap); stmt = ast_odbc_prepare_and_execute(obj, custom_prepare, &cps); @@ -447,7 +445,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char * if (strchr(chunk, '^')) { decode_chunk(chunk); } - if (initfield && !strcmp(initfield, coltitle)) { + if (!strcmp(initfield, coltitle)) { ast_category_rename(cat, chunk); } var = ast_variable_new(coltitle, chunk, ""); |