src/solaris/native/java/net/Inet6AddressImpl.c

Print this page

        

@@ -62,11 +62,11 @@
 JNIEXPORT jstring JNICALL
 Java_java_net_Inet6AddressImpl_getLocalHostName(JNIEnv *env, jobject this) {
     char hostname[NI_MAXHOST+1];
 
     hostname[0] = '\0';
-    if (JVM_GetHostName(hostname, MAXHOSTNAMELEN)) {
+    if (JVM_GetHostName(hostname, sizeof(hostname))) {
         /* Something went wrong, maybe networking is not setup? */
         strcpy(hostname, "localhost");
     } else {
 #ifdef __linux__
         /* On Linux gethostname() says "host.domain.sun.com".  On