[sr-dev] git:4.1: avpops: switched from initialize struct with {0} to memset

Daniel-Constantin Mierla miconda at gmail.com
Tue Apr 22 10:15:18 CEST 2014


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Apr 22 10:12:21 2014 +0200

avpops: switched from initialize struct with {0} to memset

- apparently gcc doesn't like it although it should be the standard
- clang is ok with it
- reported by Juha Heinanen

(cherry picked from commit f0e8c293e28b3761d0f13e2c604eb1cfbbad7ace)

---

 modules/avpops/avpops_impl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/avpops/avpops_impl.c b/modules/avpops/avpops_impl.c
index 84ebbbb..c3fc69a 100644
--- a/modules/avpops/avpops_impl.c
+++ b/modules/avpops/avpops_impl.c
@@ -291,7 +291,7 @@ int ops_dbload_avps (struct sip_msg* msg, struct fis_param *sp,
 	str *s0, *s1, *s2;
 	int_str avp_name;
 	int avp_type = 0;
-	pv_value_t xvalue = {0};
+	pv_value_t xvalue;
 
 	s0 = s1 = s2 = NULL;
 	if (!((sp->opd&AVPOPS_VAL_PVAR)||(sp->opd&AVPOPS_VAL_STR))) {
@@ -299,6 +299,8 @@ int ops_dbload_avps (struct sip_msg* msg, struct fis_param *sp,
 		goto error;
 	}
 
+	memset(&xvalue, 0, sizeof(pv_value_t));
+
 	/* get uuid from avp */
 	if (sp->opd&AVPOPS_VAL_PVAR)
 	{




More information about the sr-dev mailing list