summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 59e454bfc..052749122 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2786,8 +2786,9 @@ check_sysfile (const char *path, DWORD fileattr, HANDLE h,
NUL. The length returned is the path without
*any* trailing NULs. We also have to handle (or
at least not die from) corrupted paths. */
- if (memchr (contents, 0, got) != NULL)
- res = strlen (contents);
+ char *end;
+ if ((end = (char *) memchr (contents, 0, got)) != NULL)
+ res = end - contents;
else
res = got;
}