You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by fi...@apache.org on 2007/09/07 08:56:09 UTC
svn commit: r573481 - /apr/apr/branches/0.9.x/network_io/unix/inet_ntop.c
Author: fielding
Date: Thu Sep 6 23:56:08 2007
New Revision: 573481
URL: http://svn.apache.org/viewvc?rev=573481&view=rev
Log:
Quiet a warning on OS X about cur.len being used without initialization.
This may fix a bug in IPv6 handling, depending on whether or not the
compiler zeroes non-static structure members by default.
Modified:
apr/apr/branches/0.9.x/network_io/unix/inet_ntop.c
Modified: apr/apr/branches/0.9.x/network_io/unix/inet_ntop.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/network_io/unix/inet_ntop.c?rev=573481&r1=573480&r2=573481&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/network_io/unix/inet_ntop.c (original)
+++ apr/apr/branches/0.9.x/network_io/unix/inet_ntop.c Thu Sep 6 23:56:08 2007
@@ -147,7 +147,7 @@
* to use pointer overlays. All the world's not a VAX.
*/
char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
- struct { int base, len; } best, cur;
+ struct { int base, len; } best = {-1, 0}, cur = {-1, 0};
unsigned int words[IN6ADDRSZ / INT16SZ];
int i;
const unsigned char *next_src, *src_end;
@@ -161,8 +161,6 @@
next_src = src;
src_end = src + IN6ADDRSZ;
next_dest = words;
- best.base = -1;
- cur.base = -1;
i = 0;
do {
unsigned int next_word = (unsigned int)*next_src++;