Skip to content

Commit

Permalink
Fix libidn really absent + NetBSD fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wtoorop committed Oct 29, 2015
1 parent 0a717f5 commit de59b70
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
27 changes: 16 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ dnl ----- Start of "Things needed for gldns" section
dnl -----
dnl ---------------------------------------------------------------------------

AC_CHECK_HEADERS([stdarg.h stdint.h netinet/in.h arpa/inet.h netdb.h sys/socket.h time.h sys/time.h bsd/string.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS([stdarg.h stdint.h netinet/in.h arpa/inet.h netdb.h sys/socket.h time.h sys/time.h bsd/string.h sys/select.h],,, [AC_INCLUDES_DEFAULT])

dnl Check the printf-format attribute (if any)
dnl result in HAVE_ATTR_FORMAT.
Expand Down Expand Up @@ -975,6 +975,14 @@ AC_SUBST(C99COMPATFLAGS)

AH_BOTTOM([
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
#include <string.h>
#ifdef HAVE_BSD_STRING_H
#include <bsd/string.h>
#endif
#ifdef __cplusplus
extern "C" {
Expand All @@ -985,11 +993,13 @@ extern "C" {
#include <stddef.h>
#endif
#if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY
#if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY || !defined(strlcpy)
size_t strlcpy(char *dst, const char *src, size_t siz);
#else
#ifndef __BSD_VISIBLE
#define __BSD_VISIBLE 1
#endif
#endif
#if !defined(HAVE_ARC4RANDOM) || !HAVE_DECL_ARC4RANDOM
uint32_t arc4random(void);
#endif
Expand Down Expand Up @@ -1030,11 +1040,6 @@ unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
# define GLDNS_BUILD_CONFIG_HAVE_SSL 1
#endif
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
Expand All @@ -1045,6 +1050,10 @@ unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
Expand Down Expand Up @@ -1092,10 +1101,6 @@ unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
# endif
#endif
#ifdef HAVE_BSD_STRING_H
#include <bsd/string.h>
#endif
#ifdef HAVE_LIBUNBOUND
#include <unbound.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ set_os_defaults(struct getdns_context *context)
token = parse + strcspn(parse, " \t\r\n");
*token = 0;

(void) strcpy(domain, parse);
(void) strlcpy(domain, parse, sizeof(domain));

} else if (strncmp(parse, "search", 6) == 0) {
parse += 6;
Expand Down
2 changes: 1 addition & 1 deletion src/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
#include <string.h>
#include <arpa/inet.h>
#include <locale.h>
#include <stringprep.h>
#include "config.h"
#ifdef HAVE_LIBIDN
#include <stringprep.h>
#include <idna.h>
#endif
#include "getdns/getdns.h"
Expand Down

0 comments on commit de59b70

Please sign in to comment.