Kaynağa Gözat

* Compat/random code fixes

svn: 1434
Bryan Drewery 21 yıl önce
ebeveyn
işleme
e0f8955592
3 değiştirilmiş dosya ile 11 ekleme ve 13 silme
  1. 1 1
      src/Makefile.in
  2. 10 10
      src/adns.c
  3. 0 2
      src/debug.c

+ 1 - 1
src/Makefile.in

@@ -91,7 +91,7 @@ stringfix: stringfix.c common.h ../config.h eggdrop.h
 	@echo ""
 	@echo "Linking wraith... $(EGGBUILD)"
 	@echo ""
-	@$(LD) -o ../$(EGGEXEC) $(OBJS) $(MODOBJS) $(LIBS) compat/*.o crypto/*.o
+	$(LD) -o ../$(EGGEXEC) $(OBJS) $(MODOBJS) $(LIBS) compat/*.o crypto/*.o
 	@$(STRIP) ../$(EGGEXEC)
 	@$(OBJCOPY) ../$(EGGEXEC)
 	@echo "Successful compile: $(EGGEXEC)"

+ 10 - 10
src/adns.c

@@ -328,7 +328,7 @@ int egg_dns_lookup(const char *host, int timeout, dns_callback_t callback, void
 
 	/* Ok, now see if it's in our host cache. */
 	for (i = 0; i < nhosts; i++) {
-		if (!strcasecmp(host, hosts[i].host)) {
+		if (!egg_strcasecmp(host, hosts[i].host)) {
 			dns_answer_t answer;
 
 			answer_init(&answer);
@@ -380,7 +380,7 @@ int egg_dns_reverse(const char *ip, int timeout, dns_callback_t callback, void *
 
 	/* Ok, see if we have it in our host cache. */
 	for (i = 0; i < nhosts; i++) {
-		if (!strcasecmp(hosts[i].ip, ip)) {
+		if (!egg_strcasecmp(hosts[i].ip, ip)) {
 			dns_answer_t answer;
 
 			answer_init(&answer);
@@ -574,7 +574,7 @@ static int read_thing(char *buf, char *ip)
 	skip = strspn(buf, separators);
 	buf += skip;
 	len = strcspn(buf, separators);
-	memcpy(ip, buf, len);
+	egg_memcpy(ip, buf, len);
 	ip[len] = 0;
 	return(skip + len);
 }
@@ -620,7 +620,7 @@ static int make_header(char *buf, int id)
 {
 	_dns_header.question_count = htons(1);
 	_dns_header.id = htons(id);
-	memcpy(buf, &_dns_header, 12);
+	egg_memcpy(buf, &_dns_header, 12);
 	return(12);
 }
 
@@ -634,14 +634,14 @@ static int cut_host(const char *host, char *query)
 		len = period - host;
 		if (len > 63) return(-1);
 		*query++ = len;
-		memcpy(query, host, len);
+		egg_memcpy(query, host, len);
 		query += len;
 		host = period+1;
 	}
 	len = strlen(host);
 	if (len) {
 		*query++ = len;
-		memcpy(query, host, len);
+		egg_memcpy(query, host, len);
 		query += len;
 	}
 	*query++ = 0;
@@ -656,14 +656,14 @@ static int reverse_ip(const char *host, char *reverse)
 	period = strchr(host, '.');
 	if (!period) {
 		len = strlen(host);
-		memcpy(reverse, host, len);
+		egg_memcpy(reverse, host, len);
 		return(len);
 	}
 	else {
 		len = period - host;
 		offset = reverse_ip(host+len+1, reverse);
 		reverse[offset++] = '.';
-		memcpy(reverse+offset, host, len);
+		egg_memcpy(reverse+offset, host, len);
 		reverse[offset+len] = 0;
 		return(offset+len);
 	}
@@ -714,7 +714,7 @@ static void parse_reply(char *response, int nbytes)
 	int i;
 
 	ptr = (unsigned char *) response;
-	memcpy(&header, ptr, 12);
+	egg_memcpy(&header, ptr, 12);
 	ptr += 12;
 
 	header.id = ntohs(header.id);
@@ -743,7 +743,7 @@ static void parse_reply(char *response, int nbytes)
 		result[0] = 0;
 		/* Read in the answer. */
 		ptr += skip_name(ptr);
-		memcpy(&reply, ptr, 10);
+		egg_memcpy(&reply, ptr, 10);
 		reply.type = ntohs(reply.type);
 		reply.rdlength = ntohs(reply.rdlength);
 		reply.ttl = ntohl(reply.ttl);

+ 0 - 2
src/debug.c

@@ -308,8 +308,6 @@ static void got_cont(int z)
   detected(DETECT_SIGCONT, "POSSIBLE HIJACK DETECTED");
 }
 
-/* A call to resolver (gethostbyname, etc) timed out
- */
 static void got_alarm(int) __attribute__((noreturn));
 
 static void got_alarm(int z)