Replace call to strnlen with call to strlen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index d3e0bb6..ca24448 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -12,7 +12,6 @@
#include <io.h>
#include <fcntl.h>
#include <ws2tcpip.h>
-#include <string.h>
int p_unlink(const char *path)
{
@@ -100,7 +99,7 @@ static int do_lstat(
buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));
buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));
buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
-
+
/* Windows symlinks have zero file size, call readlink to determine
* the length of the path pointed to, which we expect everywhere else
*/
@@ -108,13 +107,13 @@ static int do_lstat(
{
char target[GIT_WIN_PATH];
int readlink_result;
-
+
readlink_result = p_readlink(file_name, target, GIT_WIN_PATH);
-
+
if (readlink_result == -1)
return -1;
-
- buf->st_size = strnlen(target, GIT_WIN_PATH);
+
+ buf->st_size = strlen(target);
}
return 0;