]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: fix windows copyFindData
authorRuss Cox <rsc@golang.org>
Wed, 13 Jun 2012 20:44:19 +0000 (16:44 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 13 Jun 2012 20:44:19 +0000 (16:44 -0400)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6301076

src/pkg/syscall/ztypes_windows.go

index 73c780c5d7f77ea68dd21249601e65d3a56e3946..485a0cc5c5a29aaabbaa15597377376e14f76c5c 100644 (file)
@@ -376,11 +376,9 @@ func copyFindData(dst *Win32finddata, src *win32finddata1) {
        dst.Reserved0 = src.Reserved0
        dst.Reserved1 = src.Reserved1
 
-       // The src is 1 element shorter than dst. Zero that last one.
+       // The src is 1 element bigger than dst, but it must be NUL.
        copy(dst.FileName[:], src.FileName[:])
-       dst.FileName[len(dst.FileName)-1] = 0
        copy(dst.AlternateFileName[:], src.AlternateFileName[:])
-       src.AlternateFileName[len(dst.AlternateFileName)-1] = 0
 }
 
 type ByHandleFileInformation struct {