mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 04:19:21 +08:00
* path.cc (readlink): Avoid calling strlen() twice.
This commit is contained in:
parent
34903c1c25
commit
efb1f061f1
@ -1,3 +1,7 @@
|
||||
2012-03-08 Václav Zeman <vhaisman@gmail.com>
|
||||
|
||||
* path.cc (readlink): Avoid calling strlen() twice.
|
||||
|
||||
2012-03-07 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* Throughout, replace usage of w32api's min with MIN from sys/param.h.
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user