diff options
| author | Patrick Pokatilo <mail@shyxormz.net> | 2013-02-08 01:26:04 +0100 |
|---|---|---|
| committer | Patrick Pokatilo <mail@shyxormz.net> | 2013-02-08 01:26:04 +0100 |
| commit | a49e5bed8d2c9cdbcfcb43c679eee88875183dd7 (patch) | |
| tree | be6d9a29584c986eb9e022c015e2f0d0bb98df48 /src/win32/posix_w32.c | |
| parent | f88885e339699ece048ebec3706736b491526939 (diff) | |
| download | libgit2-a49e5bed8d2c9cdbcfcb43c679eee88875183dd7.tar.gz | |
Replace call to strnlen with call to strlen
Diffstat (limited to 'src/win32/posix_w32.c')
| -rw-r--r-- | src/win32/posix_w32.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c index d3e0bb66a..ca244485a 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; |
