[sr-dev] git:master: modules_k/ sqlops Passed by value variable modified in function causes no effects in calling code

Marius Zbihlei marius.zbihlei at 1and1.ro
Wed Apr 27 15:31:04 CEST 2011


Module: sip-router
Branch: master
Commit: 93514b0efdf526549bb19ae9c24e1612dced43c2
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=93514b0efdf526549bb19ae9c24e1612dced43c2

Author: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Date:   Wed Apr 27 16:24:42 2011 +0300

modules_k/sqlops Passed by value variable modified in function causes no effects in calling code

Modify instead the value pointed by the pointer.

---

 modules_k/sqlops/sql_api.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules_k/sqlops/sql_api.c b/modules_k/sqlops/sql_api.c
index 9149f5c..ef69071 100644
--- a/modules_k/sqlops/sql_api.c
+++ b/modules_k/sqlops/sql_api.c
@@ -671,7 +671,7 @@ int sqlops_get_column(str *sres, int i, str *col)
 		LM_ERR("column index out of bounds [%d/%d]\n", i, res->ncols);
 		goto error;
 	}
-	col = &res->cols[i].name;
+	*col = res->cols[i].name;
 	return 0;
 error:
 	return -1;




More information about the sr-dev mailing list