Explorar o código

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

Modify instead the value pointed by the pointer.
Marius Zbihlei %!s(int64=14) %!d(string=hai) anos
pai
achega
93514b0efd
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      modules_k/sqlops/sql_api.c

+ 1 - 1
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;