diff options
author | Dmitry Bagdanov <dimbo_job@mail.ru> | 2019-05-02 23:42:35 +0700 |
---|---|---|
committer | Dmitry Bagdanov <dimbo_job@mail.ru> | 2019-05-02 23:42:35 +0700 |
commit | 68f43513a383533ae4335c2e068c1d7a9dfa59f6 (patch) | |
tree | f786e448745e3b07cc85395b5e58b2d2602f9b14 | |
parent | Update AUTHORS file (diff) | |
download | wireguard-windows-68f43513a383533ae4335c2e068c1d7a9dfa59f6.tar.xz wireguard-windows-68f43513a383533ae4335c2e068c1d7a9dfa59f6.zip |
Replace call to deprecated StringToUTF16Ptr() with UTF16PtrFromString()
-rw-r--r-- | fontresource.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fontresource.go b/fontresource.go index 61f90307..1496232a 100644 --- a/fontresource.go +++ b/fontresource.go @@ -58,7 +58,12 @@ func newFontMemResource(resourceName *uint16) (*FontMemResource, error) { // The font must be embedded into resources using corresponding operator in the
// application's RC script.
func NewFontMemResourceByName(name string) (*FontMemResource, error) {
- return newFontMemResource(syscall.StringToUTF16Ptr(name))
+ lpstr, err := syscall.UTF16PtrFromString(name)
+ if err != nil {
+ return nil, err
+ }
+
+ return newFontMemResource(lpstr)
}
// NewFontMemResourceById function loads a font resource from the executable's resources
|