Skip to content

Commit

Permalink
Fixed panic in convertAnsiBytesToString implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Oct 16, 2024
1 parent cff613f commit 91c7fb3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/arduino/builder/internal/utils/ansi_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import (
)

func convertAnsiBytesToString(data []byte) (string, error) {
if len(data) == 0 {
return "", nil
}
dataSize := int32(len(data))
size, err := windows.MultiByteToWideChar(windows.GetACP(), 0, &data[0], dataSize, nil, 0)
if err != nil {
Expand Down

0 comments on commit 91c7fb3

Please sign in to comment.