[svn-commits] simon.perreault: branch group/v6-new r272648 - /team/group/v6-new/main/http.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jun 28 08:58:05 CDT 2010


Author: simon.perreault
Date: Mon Jun 28 08:58:01 2010
New Revision: 272648

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=272648
Log:
Initialize variables at declaration instead of using memset().

Modified:
    team/group/v6-new/main/http.c

Modified: team/group/v6-new/main/http.c
URL: http://svnview.digium.com/svn/asterisk/team/group/v6-new/main/http.c?view=diff&rev=272648&r1=272647&r2=272648
==============================================================================
--- team/group/v6-new/main/http.c (original)
+++ team/group/v6-new/main/http.c Mon Jun 28 08:58:01 2010
@@ -992,8 +992,8 @@
 	char newprefix[MAX_PREFIX] = "";
 	struct http_uri_redirect *redirect;
 	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
-	struct sockaddr_in tmp;
-	struct sockaddr_in tmp2;
+	struct sockaddr_in tmp = {0,};
+	struct sockaddr_in tmp2 = {0,};
 
 	cfg = ast_config_load2("http.conf", "http", config_flags);
 	if (cfg == CONFIG_STATUS_FILEMISSING || cfg == CONFIG_STATUS_FILEUNCHANGED || cfg == CONFIG_STATUS_FILEINVALID) {
@@ -1001,13 +1001,11 @@
 	}
 
 	/* default values */
-	memset(&tmp, 0, sizeof(tmp));
 	tmp.sin_port = htons(8088);
 	http_desc.local_address = ast_sockaddr_from_sin(tmp);
 
-	memset(&tmp, 0, sizeof(tmp));
-	tmp.sin_port = htons(8089);
-	https_desc.local_address = ast_sockaddr_from_sin(tmp);
+	tmp2.sin_port = htons(8089);
+	https_desc.local_address = ast_sockaddr_from_sin(tmp2);
 
 	http_tls_cfg.enabled = 0;
 	if (http_tls_cfg.certfile) {




More information about the svn-commits mailing list