[sr-dev] git:master:23b476ed: core: init vars for socket ttl helper function to avoid warnings

Daniel-Constantin Mierla miconda at gmail.com
Thu May 14 12:00:29 CEST 2015


Module: kamailio
Branch: master
Commit: 23b476ed7c7b48ddd7cacf3d88e9c104db06d5dc
URL: https://github.com/kamailio/kamailio/commit/23b476ed7c7b48ddd7cacf3d88e9c104db06d5dc

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-05-14T10:25:47+02:00

core: init vars for socket ttl helper function to avoid warnings

---

Modified: sock_ut.c

---

Diff:  https://github.com/kamailio/kamailio/commit/23b476ed7c7b48ddd7cacf3d88e9c104db06d5dc.diff
Patch: https://github.com/kamailio/kamailio/commit/23b476ed7c7b48ddd7cacf3d88e9c104db06d5dc.patch

---

diff --git a/sock_ut.c b/sock_ut.c
index 69764c5..b1da20d 100644
--- a/sock_ut.c
+++ b/sock_ut.c
@@ -35,8 +35,8 @@
  */
 int sock_get_ttl(int sock)
 {
-	int ioptval;
-	unsigned int ioptvallen;
+	int ioptval = 0;
+	unsigned int ioptvallen = 0;
 
 	ioptvallen=sizeof(ioptval);
 	if (getsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
@@ -54,7 +54,7 @@ int sock_get_ttl(int sock)
  */
 int sock_set_ttl(int sock, int ttl)
 {
-	int ioptval;
+	int ioptval = 0;
 
 	if (setsockopt( sock, IPPROTO_IP, IP_TTL, (void*) &ioptval,
 					sizeof(ioptval)) == -1 )




More information about the sr-dev mailing list