From: Mark Andrews Date: Wed, 30 Aug 2006 23:23:14 +0000 (+0000) Subject: 2080. [port] libbind: res_init.c did not compile on older versions X-Git-Tag: v9.2.7rc2~7 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=4f3933a80bc9cbdd660ab9fc62ec8c432b70a9ad;p=thirdparty%2Fbind9.git 2080. [port] libbind: res_init.c did not compile on older versions of Solaris. [RT #16363] --- diff --git a/CHANGES b/CHANGES index 17d7606229b..5c086736509 100644 --- 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 causing build failures on OSF. [RT #16341] diff --git a/lib/bind/resolv/res_init.c b/lib/bind/resolv/res_init.c index 9af5f2da553..d3bb71f5458 100644 --- a/lib/bind/resolv/res_init.c +++ b/lib/bind/resolv/res_init.c @@ -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.10 2005/11/03 00:00:08 marka Exp $"; +static const char rcsid[] = "$Id: res_init.c,v 1.9.2.11 2006/08/30 23:23:14 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 */