diff options
Diffstat (limited to 'libgo/go/path/filepath/symlink_windows.go')
-rw-r--r-- | libgo/go/path/filepath/symlink_windows.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libgo/go/path/filepath/symlink_windows.go b/libgo/go/path/filepath/symlink_windows.go index 1ee939928e9..9adc8a48af0 100644 --- a/libgo/go/path/filepath/symlink_windows.go +++ b/libgo/go/path/filepath/symlink_windows.go @@ -9,7 +9,10 @@ import ( ) func toShort(path string) (string, error) { - p := syscall.StringToUTF16(path) + p, err := syscall.UTF16FromString(path) + if err != nil { + return "", err + } b := p // GetShortPathName says we can reuse buffer n, err := syscall.GetShortPathName(&p[0], &b[0], uint32(len(b))) if err != nil { @@ -26,7 +29,10 @@ func toShort(path string) (string, error) { } func toLong(path string) (string, error) { - p := syscall.StringToUTF16(path) + p, err := syscall.UTF16FromString(path) + if err != nil { + return "", err + } b := p // GetLongPathName says we can reuse buffer n, err := syscall.GetLongPathName(&p[0], &b[0], uint32(len(b))) if err != nil { |