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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 8 13:08:02 CDT 2010


Author: simon.perreault
Date: Thu Jul  8 13:07:59 2010
New Revision: 274771

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=274771
Log:
Replaced memcpy() with explicit cast. This is better because the compiler can catch
programming errors.

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

Modified: team/group/v6-new/main/netsock2.c
URL: http://svnview.digium.com/svn/asterisk/team/group/v6-new/main/netsock2.c?view=diff&rev=274771&r1=274770&r2=274771
==============================================================================
--- team/group/v6-new/main/netsock2.c (original)
+++ team/group/v6-new/main/netsock2.c Thu Jul  8 13:07:59 2010
@@ -483,13 +483,13 @@
 		ast_log(LOG_DEBUG, "Address family is not AF_INET\n");
 	}
 
-	memcpy(sin, &addr->ss, sizeof(*sin));
+	*sin = *(struct sockaddr_in *)&addr->ss;
 	return 1;
 }
 
 void ast_sockaddr_from_sin(struct ast_sockaddr *addr, const struct sockaddr_in *sin)
 {
-	memcpy(&addr->ss, sin, sizeof(*sin));
+	*((struct sockaddr_in *)&addr->ss) = *sin;
 
 	if (addr->ss.ss_family != AF_INET) {
 		ast_log(LOG_DEBUG, "Address family is not AF_INET\n");




More information about the svn-commits mailing list