diff options
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | gethost.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index a7d72e9..c03d9df 100644 --- a/configure.ac +++ b/configure.ac @@ -36,11 +36,12 @@ XORG_DEFAULT_OPTIONS AC_PROG_CC AC_PROG_INSTALL - AC_TYPE_SIGNAL AC_CHECK_HEADERS([net/errno.h]) +AC_CHECK_FUNCS([strlcpy]) + # Checks for pkg-config packages PKG_CHECK_MODULES(XAUTH, x11 xau xext xmuu) AC_SUBST(XAUTH_CFLAGS) @@ -283,7 +283,13 @@ struct addrlist *get_address_info ( } else if(prefix == 0 && (strncmp (fulldpyname, "/tmp/launch", 11) == 0)) { /* Use the bundle id (part preceding : in the basename) as our src id */ char *c; +#ifdef HAVE_STRLCPY strlcpy(buf, strrchr(fulldpyname, '/') + 1, sizeof(buf)); +#else + strncpy(buf, strrchr(fulldpyname, '/') + 1, sizeof(buf)); + buf[sizeof(buf) - 1] = '\0'; +#endif + c = strchr(buf, ':'); /* In the legacy case with no bundle id, use the full path */ |