From a58c9d74c8f9c4292d367c6e23d15c4cba03dfde Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 2 Jan 2015 16:18:52 +0000 Subject: Fix !HAVE_STRLCPY case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston Sequoia --- gethost.c | 2 +- parsedpy.c | 2 +- 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; -- cgit v1.2.1