From e233777dbe95d8c8e4135a098503660c6dbaa451 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 19 Mar 2006 17:18:32 +0000 Subject: (__getcwd): Clarify a comment. Use memcpy in place of a call to strcpy. --- lib/getcwd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/getcwd.c') diff --git a/lib/getcwd.c b/lib/getcwd.c index 5bb9e4be1..739ef44c7 100644 --- a/lib/getcwd.c +++ b/lib/getcwd.c @@ -260,8 +260,8 @@ __getcwd (char *buf, size_t size) if (d == NULL) { if (errno == 0) - /* EOF on dirstream, which means that the current directory - has been removed. */ + /* EOF on dirstream, which can mean e.g., that the current + directory has been removed. */ __set_errno (ENOENT); goto lose; } @@ -309,7 +309,7 @@ __getcwd (char *buf, size_t size) while (i < dotlen); } - strcpy (dotlist + dotlen, d->d_name); + memcpy (dotlist + dotlen, d->d_name, _D_ALLOC_NAMLEN (d)); entry_status = __lstat (dotlist, &st); #endif /* We don't fail here if we cannot stat() a directory entry. -- cgit v1.2.3-54-g00ecf