]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2080. [port] libbind: res_init.c did not compile on older versions
authorMark Andrews <marka@isc.org>
Wed, 30 Aug 2006 23:23:01 +0000 (23:23 +0000)
committerMark Andrews <marka@isc.org>
Wed, 30 Aug 2006 23:23:01 +0000 (23:23 +0000)
                        of Solaris. [RT #16363]

CHANGES
lib/bind/resolv/res_init.c

diff --git a/CHANGES b/CHANGES
index e14d5c85ad8fe699c2e62180d5f84b1a9b38b7d9..e13dba91cb4336878b1ebd58d905c2fd4868c871 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2080.  [port]          libbind: res_init.c did not compile on older versions
+                       of Solaris. [RT #16363]
+
 2076.  [bug]           Several files were missing #include <config.h>
                        causing build failures on OSF. [RT #16341]
 
index 28a3ebd088e9ee5c5a4680570e6a5d4d023b8522..fd82e87203c054a3c9412be54b92b3c5988db870 100644 (file)
@@ -70,7 +70,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static const char sccsid[] = "@(#)res_init.c   8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.5 2005/11/03 00:00:52 marka Exp $";
+static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.6 2006/08/30 23:23:01 marka Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include "port_before.h"
@@ -237,17 +237,10 @@ __res_vinit(res_state statp, int preinit) {
                        if (buf[0] == '+')
                                buf[0] = '.';
                        cp = strchr(buf, '.');
-                       if (cp == NULL) {
-                               if (strlcpy(statp->defdname, buf,
-                                       sizeof(statp->defdname))
-                                       >= sizeof(statp->defdname))
-                                       goto freedata;
-                       } else {
-                               if (strlcpy(statp->defdname, cp+1,
-                                       sizeof(statp->defdname))
-                                        >= sizeof(statp->defdname))
-                                       goto freedata;
-                       }
+                       cp = (cp == NULL) ? buf : (cp + 1);
+                       if (strlen(cp) >= sizeof(statp->defdname))
+                               goto freedata; 
+                       strcpy(statp->defdname, cp);
                }
        }
 #endif /* SOLARIS2 */