diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-19 21:13:41 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-19 21:13:41 +0000 |
commit | 10717cc766b828c2b0b344ad7cd74148939bc294 (patch) | |
tree | 788562539a60bddcdd1880d1d76415845a03beac /apps/app_sql_postgres.c | |
parent | e5d58524be40d77f9d4717c40afff6b5c31fb1c3 (diff) |
Merge Olle's comment patch (bug #3097)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4488 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_sql_postgres.c')
-rwxr-xr-x | apps/app_sql_postgres.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/apps/app_sql_postgres.c b/apps/app_sql_postgres.c index 1620df635..f2e99dea4 100755 --- a/apps/app_sql_postgres.c +++ b/apps/app_sql_postgres.c @@ -226,7 +226,7 @@ static int aPGSQL_connect(struct ast_channel *chan, void *data) { s1=malloc(l); strncpy(s1, data, l -1); stringp=s1; - strsep(&stringp," "); // eat the first token, we already know it :P + strsep(&stringp," "); /* eat the first token, we already know it :P */ var=strsep(&stringp," "); optionstring=strsep(&stringp,"\n"); @@ -267,9 +267,9 @@ static int aPGSQL_query(struct ast_channel *chan, void *data) { s2=malloc(l); strncpy(s1, data, l - 1); stringp=s1; - strsep(&stringp," "); // eat the first token, we already know it :P + strsep(&stringp," "); /* eat the first token, we already know it :P */ s3=strsep(&stringp," "); - while (1) { // ugly trick to make branches with break; + while (1) { /* ugly trick to make branches with break; */ var=s3; s4=strsep(&stringp," "); id=atoi(s4); @@ -330,10 +330,10 @@ static int aPGSQL_fetch(struct ast_channel *chan, void *data) { s2=malloc(l); strncpy(s1, data, l - 1); stringp=s1; - strsep(&stringp," "); // eat the first token, we already know it :P + strsep(&stringp," "); /* eat the first token, we already know it :P */ fetchid_var=strsep(&stringp," "); - while (1) { // ugly trick to make branches with break; - var=fetchid_var; // fetchid + while (1) { /* ugly trick to make branches with break; */ + var=fetchid_var; /* fetchid */ fnd=0; AST_LIST_TRAVERSE(headp,variables,entries) { @@ -350,19 +350,19 @@ static int aPGSQL_fetch(struct ast_channel *chan, void *data) { } s4=strsep(&stringp," "); - id=atoi(s4); // resultid + id=atoi(s4); /* resultid */ if ((PGSQLres=find_identifier(id,AST_PGSQL_ID_RESID))==NULL) { ast_log(LOG_WARNING,"Invalid result identifier %d passed in aPGSQL_fetch\n",id); res=-1; break; } - id=atoi(s7); //fetchid + id=atoi(s7); /*fetchid */ if ((lalares=find_identifier(id,AST_PGSQL_ID_FETCHID))==NULL) { - i=0; // fetching the very first row + i=0; /* fetching the very first row */ } else { i=*lalares; free(lalares); - del_identifier(id,AST_PGSQL_ID_FETCHID); // will re-add it a bit later + del_identifier(id,AST_PGSQL_ID_FETCHID); /* will re-add it a bit later */ } if (i<PQntuples(PGSQLres)) { @@ -383,11 +383,11 @@ static int aPGSQL_fetch(struct ast_channel *chan, void *data) { pbx_builtin_setvar_helper(chan,s5,s6); } lalares=malloc(sizeof(int)); - *lalares = ++i; // advance to the next row + *lalares = ++i; /* advance to the next row */ id1 = add_identifier(AST_PGSQL_ID_FETCHID,lalares); } else { ast_log(LOG_WARNING,"ast_PGSQL_fetch : EOF\n"); - id1 = 0; // no more rows + id1 = 0; /* no more rows */ } snprintf(s, sizeof(s), "%d", id1); ast_log(LOG_WARNING,"Setting var '%s' to value '%s'\n",fetchid_var,s); @@ -413,7 +413,7 @@ static int aPGSQL_reset(struct ast_channel *chan, void *data) { s1=malloc(l); strncpy(s1, data, l - 1); stringp=s1; - strsep(&stringp," "); // eat the first token, we already know it :P + strsep(&stringp," "); /* eat the first token, we already know it :P */ s3=strsep(&stringp," "); id=atoi(s3); if ((karoto=find_identifier(id,AST_PGSQL_ID_CONNID))==NULL) { @@ -439,7 +439,7 @@ static int aPGSQL_clear(struct ast_channel *chan, void *data) { s1=malloc(l); strncpy(s1, data, l - 1); stringp=s1; - strsep(&stringp," "); // eat the first token, we already know it :P + strsep(&stringp," "); /* eat the first token, we already know it :P */ s3=strsep(&stringp," "); id=atoi(s3); if ((karoto=find_identifier(id,AST_PGSQL_ID_RESID))==NULL) { @@ -469,7 +469,7 @@ static int aPGSQL_disconnect(struct ast_channel *chan, void *data) { s1=malloc(l); strncpy(s1, data, l - 1); stringp=s1; - strsep(&stringp," "); // eat the first token, we already know it :P + strsep(&stringp," "); /* eat the first token, we already know it :P */ s3=strsep(&stringp," "); id=atoi(s3); if ((karoto=find_identifier(id,AST_PGSQL_ID_CONNID))==NULL) { |