From 1c4e20744a48ee0d7cdb74ed1cab5196345cf6a2 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 13 Jun 2012 16:44:19 -0400 Subject: [PATCH] syscall: fix windows copyFindData R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6301076 --- src/pkg/syscall/ztypes_windows.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pkg/syscall/ztypes_windows.go b/src/pkg/syscall/ztypes_windows.go index 73c780c5d7..485a0cc5c5 100644 --- a/src/pkg/syscall/ztypes_windows.go +++ b/src/pkg/syscall/ztypes_windows.go @@ -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 { -- 2.48.1