diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-09-21 16:41:17 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-09-21 16:41:17 +0000 |
commit | b53c1929e5f62d1a42c31145f9010e7adfe34b09 (patch) | |
tree | faeb305747c8983a8293e33731136f2f465615d8 | |
parent | 4c9d01fdad2acbfb5d0594dbe5fb6f0f402cff72 (diff) | |
download | cygnal-b53c1929e5f62d1a42c31145f9010e7adfe34b09.tar.gz cygnal-b53c1929e5f62d1a42c31145f9010e7adfe34b09.tar.bz2 cygnal-b53c1929e5f62d1a42c31145f9010e7adfe34b09.zip |
* path.cc (cwdstuff::set): Replace constant 2 with sizeof(WCHAR) where
appropriate.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 13741ebbb..da3de3f4f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2010-09-21 Corinna Vinschen <corinna@vinschen.de> + * path.cc (cwdstuff::set): Replace constant 2 with sizeof(WCHAR) where + appropriate. + +2010-09-21 Corinna Vinschen <corinna@vinschen.de> + * mount.h (class fs_info): Add has_buggy_reopen flag and accessor methods. * mount.cc (fs_info::update): Set has_buggy_reopen flag for NWFS. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 9eac51b63..b468e9e37 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3483,8 +3483,9 @@ cwdstuff::set (path_conv *nat_cwd, const char *posix_cwd) PUNICODE_STRING pdir = &get_user_proc_parms ()->CurrentDirectoryName; RtlInitEmptyUnicodeString (&win32, (PWCHAR) crealloc_abort (win32.Buffer, - pdir->Length + 2), - pdir->Length + 2); + pdir->Length + + sizeof (WCHAR)), + pdir->Length + sizeof (WCHAR)); RtlCopyUnicodeString (&win32, pdir); PWSTR eoBuffer = win32.Buffer + (win32.Length / sizeof (WCHAR)); @@ -3520,8 +3521,9 @@ cwdstuff::set (path_conv *nat_cwd, const char *posix_cwd) } RtlInitEmptyUnicodeString (&win32, (PWCHAR) crealloc_abort (win32.Buffer, - upath.Length + 2), - upath.Length + 2); + upath.Length + + sizeof (WCHAR)), + upath.Length + sizeof (WCHAR)); RtlCopyUnicodeString (&win32, &upath); if (unc_path) win32.Buffer[0] = L'\\'; |