summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2007-06-25 09:44:35 +0000
committerMark Wielaard <mark@klomp.org>2007-06-25 09:44:35 +0000
commit38d71ece08e54b4c738f17049a9bb4e84c616b77 (patch)
tree6760418c50f22f1c7bbe61d721dd17e7856f2aa2 /native
parent44a90baeafad37be5995b092a37dea635c617190 (diff)
downloadclasspath-38d71ece08e54b4c738f17049a9bb4e84c616b77.tar.gz
* native/jni/native-lib/cpnet.c
(cpnet_aton) Moved variable declaration of inet6_addr so it is actually in the scope of its use.
Diffstat (limited to 'native')
-rw-r--r--native/jni/native-lib/cpnet.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/native/jni/native-lib/cpnet.c b/native/jni/native-lib/cpnet.c
index 7017fc172..044498113 100644
--- a/native/jni/native-lib/cpnet.c
+++ b/native/jni/native-lib/cpnet.c
@@ -767,6 +767,10 @@ jint cpnet_aton (JNIEnv *env, const char *hostname, cpnet_address **addr)
{
jbyte *bytes = NULL;
+#if defined(HAVE_INET_PTON) && defined(HAVE_INET6)
+ jbyte inet6_addr[16];
+#endif
+
#ifdef HAVE_INET_ATON
struct in_addr laddr;
if (inet_aton (hostname, &laddr))
@@ -793,8 +797,6 @@ jint cpnet_aton (JNIEnv *env, const char *hostname, cpnet_address **addr)
#if defined(HAVE_INET_PTON) && defined(HAVE_INET6)
if (inet_pton (AF_INET6, hostname, inet6_addr) > 0)
{
- jbyte inet6_addr[16];
-
*addr = cpnet_newIPV6Address(env);
cpnet_bytesToIPV6Address(*addr, inet6_addr);
return 0;