* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nslookup.c,v 1.127 2010/11/17 23:47:08 tbox Exp $ */
+/* $Id: nslookup.c,v 1.128 2011/02/21 07:22:21 marka Exp $ */
#include <config.h>
}
}
-static void
-safecpy(char *dest, char *src, int size) {
- strncpy(dest, src, size);
- dest[size-1] = 0;
-}
-
static void
set_port(const char *value) {
isc_uint32_t n;
show_settings(ISC_TRUE, ISC_FALSE);
} else if (strncasecmp(opt, "class=", 6) == 0) {
if (testclass(&opt[6]))
- safecpy(defclass, &opt[6], sizeof(defclass));
+ strlcpy(defclass, &opt[6], sizeof(defclass));
} else if (strncasecmp(opt, "cl=", 3) == 0) {
if (testclass(&opt[3]))
- safecpy(defclass, &opt[3], sizeof(defclass));
+ strlcpy(defclass, &opt[3], sizeof(defclass));
} else if (strncasecmp(opt, "type=", 5) == 0) {
if (testtype(&opt[5]))
- safecpy(deftype, &opt[5], sizeof(deftype));
+ strlcpy(deftype, &opt[5], sizeof(deftype));
} else if (strncasecmp(opt, "ty=", 3) == 0) {
if (testtype(&opt[3]))
- safecpy(deftype, &opt[3], sizeof(deftype));
+ strlcpy(deftype, &opt[3], sizeof(deftype));
} else if (strncasecmp(opt, "querytype=", 10) == 0) {
if (testtype(&opt[10]))
- safecpy(deftype, &opt[10], sizeof(deftype));
+ strlcpy(deftype, &opt[10], sizeof(deftype));
} else if (strncasecmp(opt, "query=", 6) == 0) {
if (testtype(&opt[6]))
- safecpy(deftype, &opt[6], sizeof(deftype));
+ strlcpy(deftype, &opt[6], sizeof(deftype));
} else if (strncasecmp(opt, "qu=", 3) == 0) {
if (testtype(&opt[3]))
- safecpy(deftype, &opt[3], sizeof(deftype));
+ strlcpy(deftype, &opt[3], sizeof(deftype));
} else if (strncasecmp(opt, "q=", 2) == 0) {
if (testtype(&opt[2]))
- safecpy(deftype, &opt[2], sizeof(deftype));
+ strlcpy(deftype, &opt[2], sizeof(deftype));
} else if (strncasecmp(opt, "domain=", 7) == 0) {
- safecpy(domainopt, &opt[7], sizeof(domainopt));
+ strlcpy(domainopt, &opt[7], sizeof(domainopt));
set_search_domain(domainopt);
usesearch = ISC_TRUE;
} else if (strncasecmp(opt, "do=", 3) == 0) {
- safecpy(domainopt, &opt[3], sizeof(domainopt));
+ strlcpy(domainopt, &opt[3], sizeof(domainopt));
set_search_domain(domainopt);
usesearch = ISC_TRUE;
} else if (strncasecmp(opt, "port=", 5) == 0) {
lookup = make_empty_lookup();
if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, ISC_TRUE)
== ISC_R_SUCCESS) {
- safecpy(lookup->textname, store, sizeof(lookup->textname));
+ strlcpy(lookup->textname, store, sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_ptr;
lookup->rdtypeset = ISC_TRUE;
} else {
- safecpy(lookup->textname, opt, sizeof(lookup->textname));
+ strlcpy(lookup->textname, opt, sizeof(lookup->textname));
lookup->rdtype = rdtype;
lookup->rdtypeset = ISC_TRUE;
}