summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2015-01-02 16:18:52 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2015-01-05 17:34:56 +0000
commita58c9d74c8f9c4292d367c6e23d15c4cba03dfde (patch)
tree6a481c7f22d1d440fb4954cd4f5affa38c4391ba
parentf990dd936b5fd1a40290bb88cde517a0ac38f823 (diff)
downloadxorg-app-xauth-a58c9d74c8f9c4292d367c6e23d15c4cba03dfde.tar.gz
Fix !HAVE_STRLCPY case
Fix error in the !HAVE_STRLCPY case, introduced in commit f990dd936b5fd1a40290bb88cde517a0ac38f823 It seems that "path[sizeof(path) - 1]" rather than "buf[sizeof(path) - 1]" must be meant here, especially as the second instance doesn't even compile... parsedpy.c: In function ‘parse_displayname’: parsedpy.c:176:9: error: ‘buf’ undeclared (first use in this function) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r--gethost.c2
-rw-r--r--parsedpy.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/gethost.c b/gethost.c
index c75ae02..e0dc8cb 100644
--- a/gethost.c
+++ b/gethost.c
@@ -200,7 +200,7 @@ struct addrlist *get_address_info (
strlcpy(path, fulldpyname, sizeof(path));
#else
strncpy(path, fulldpyname, sizeof(path));
- buf[sizeof(path) - 1] = '\0';
+ path[sizeof(path) - 1] = '\0';
#endif
if (0 == stat(path, &sbuf)) {
is_path_to_socket = 1;
diff --git a/parsedpy.c b/parsedpy.c
index 7365224..c638b26 100644
--- a/parsedpy.c
+++ b/parsedpy.c
@@ -173,7 +173,7 @@ parse_displayname (const char *displayname,
strlcpy(path, displayname, sizeof(path));
#else
strncpy(path, displayname, sizeof(path));
- buf[sizeof(path) - 1] = '\0';
+ path[sizeof(path) - 1] = '\0';
#endif
if (0 == stat(path, &sbuf)) {
family = FamilyLocal;