* 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>
|
2012-03-07 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* Throughout, replace usage of w32api's min with MIN from sys/param.h.
|
* 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;
|
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);
|
memcpy (buf, pathbuf.get_win32 (), len);
|
||||||
|
|
||||||
/* errno set by symlink.check if error */
|
/* errno set by symlink.check if error */
|
||||||
|
|
Loading…
Reference in New Issue