summaryrefslogtreecommitdiff
path: root/gethost.c
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2010-08-26 08:26:31 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2010-08-26 08:26:31 -0700
commit4f6dea33200af6d42e29b43269d8ee389db1b98f (patch)
tree690dc0d9874b8afecd70c478c11db7520c34d7f3 /gethost.c
parent135338af9a141d609e07e42208b9104465346ae4 (diff)
downloadxorg-app-xauth-4f6dea33200af6d42e29b43269d8ee389db1b98f.tar.gz
Fix build failure resulting from previous commit on systems without strlcpy
Found-by: Tinderbox Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'gethost.c')
-rw-r--r--gethost.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gethost.c b/gethost.c
index 6b36340..6612bc0 100644
--- a/gethost.c
+++ b/gethost.c
@@ -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 */