Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-03-08 18:56:18 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-03-08 18:56:18 +0400
commitefb1f061f10c50410ede9401ccddaf93240f8335 (patch)
tree4d720d2dbd45b0525b08b783d24a3355a26bde5b /winsup/cygwin/path.cc
parent34903c1c25507b69f524b74a2a34dbba00f53ef0 (diff)
* path.cc (readlink): Avoid calling strlen() twice.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 17ae5e109..ea984c2e5 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2783,7 +2783,8 @@ readlink (const char *path, char *buf, size_t buflen)
return -1;
}
- ssize_t len = MIN (buflen, strlen (pathbuf.get_win32 ()));
+ size_t pathbuf_len = strlen (pathbuf.get_win32 ());
+ ssize_t len = MIN (buflen, pathbuf_len);
memcpy (buf, pathbuf.get_win32 (), len);
/* errno set by symlink.check if error */