Module: sip-router
Branch: master
Commit: 355636358c07b8da9b1fcd6d04cdaf337c9f730c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3556363…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Thu May 20 15:46:58 2010 +0200
fix memset call, set the variable to zero, not to the size with length 0..
---
cfg/cfg_script.c | 2 +-
modules_k/xcap_client/xcap_functions.c | 2 +-
rvalue.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cfg/cfg_script.c b/cfg/cfg_script.c
index 5f33ffd..a4ef236 100644
--- a/cfg/cfg_script.c
+++ b/cfg/cfg_script.c
@@ -107,7 +107,7 @@ cfg_script_var_t *new_cfg_script_var(char *gname, char *vname,
unsigned int type
var = (cfg_script_var_t *)pkg_malloc(sizeof(cfg_script_var_t));
if (!var) goto error;
- memset(var, sizeof(cfg_script_var_t), 0);
+ memset(var, 0, sizeof(cfg_script_var_t));
var->type = type;
/* add the variable to the group */
diff --git a/modules_k/xcap_client/xcap_functions.c
b/modules_k/xcap_client/xcap_functions.c
index 1d3cea6..ba049e4 100644
--- a/modules_k/xcap_client/xcap_functions.c
+++ b/modules_k/xcap_client/xcap_functions.c
@@ -531,7 +531,7 @@ char* send_http_get(char* path, unsigned int xcap_port, char*
match_etag,
{
char* hdr_name= NULL;
- memset(buf, 128* sizeof(char), 0);
+ memset(buf, 0, 128* sizeof(char));
match_header= buf;
hdr_name= (match_type==IF_MATCH)?"If-Match":"If-None-Match";
diff --git a/rvalue.c b/rvalue.c
index d02b194..38a0eb7 100644
--- a/rvalue.c
+++ b/rvalue.c
@@ -2448,7 +2448,7 @@ struct rval_expr* mk_rval_expr_v(enum rval_type rv_type, void* val,
rve=pkg_malloc(sizeof(*rve));
if (rve==0)
return 0;
- memset(rve, sizeof(*rve), 0);
+ memset(rve, 0, sizeof(*rve));
flags=0;
switch(rv_type){
case RV_INT:
@@ -2522,7 +2522,7 @@ struct rval_expr* mk_rval_expr1(enum rval_expr_op op, struct
rval_expr* rve1,
ret=pkg_malloc(sizeof(*ret));
if (ret==0)
return 0;
- memset(ret, sizeof(*ret), 0);
+ memset(ret, 0, sizeof(*ret));
ret->op=op;
ret->left.rve=rve1;
if (pos) ret->fpos=*pos;
@@ -2575,7 +2575,7 @@ struct rval_expr* mk_rval_expr2(enum rval_expr_op op, struct
rval_expr* rve1,
ret=pkg_malloc(sizeof(*ret));
if (ret==0)
return 0;
- memset(ret, sizeof(*ret), 0);
+ memset(ret, 0, sizeof(*ret));
ret->op=op;
ret->left.rve=rve1;
ret->right.rve=rve2;