projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
maint: update copyright
[gnulib.git]
/
lib
/
inet_ntop.c
diff --git
a/lib/inet_ntop.c
b/lib/inet_ntop.c
index
d7e6b23
..
0e04d25
100644
(file)
--- a/
lib/inet_ntop.c
+++ b/
lib/inet_ntop.c
@@
-1,6
+1,6
@@
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
- Copyright (C) 2005-2006, 2008-201
2
Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2008-201
4
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-13,8
+13,7
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/*
* Copyright (c) 1996-1999 by Internet Software Consortium.
/*
* Copyright (c) 1996-1999 by Internet Software Consortium.
@@
-38,6
+37,16
@@
/* Specification. */
#include <arpa/inet.h>
/* Specification. */
#include <arpa/inet.h>
+/* Use this to suppress gcc's "...may be used before initialized" warnings.
+ Beware: The Code argument must not contain commas. */
+#ifndef IF_LINT
+# ifdef lint
+# define IF_LINT(Code) Code
+# else
+# define IF_LINT(Code) /* empty */
+# endif
+#endif
+
#if HAVE_DECL_INET_NTOP
# undef inet_ntop
#if HAVE_DECL_INET_NTOP
# undef inet_ntop
@@
-166,8
+175,9
@@
inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
for (i = 0; i < NS_IN6ADDRSZ; i += 2)
words[i / 2] = (src[i] << 8) | src[i + 1];
best.base = -1;
for (i = 0; i < NS_IN6ADDRSZ; i += 2)
words[i / 2] = (src[i] << 8) | src[i + 1];
best.base = -1;
- best.len = 0;
cur.base = -1;
cur.base = -1;
+ IF_LINT(best.len = 0);
+ IF_LINT(cur.len = 0);
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
{
if (words[i] == 0)
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
{
if (words[i] == 0)