Skip to content

Commit

Permalink
Fix false use of copy in bytecolor2colorcode
Browse files Browse the repository at this point in the history
Signed-off-by: Malte Muench <[email protected]>
  • Loading branch information
Malte Muench committed Nov 1, 2024
1 parent 30ddd65 commit 7424abb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/convertmode/bytecolor2colorcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (_ ByteColor2ColorCode) ToCan(input []byte) (can.Frame, error) {
return can.Frame{}, errors.New(fmt.Sprintf("Error while converting: %s", err.Error()))
}
var returner = can.Frame{Length: 3}
copy(res, returner.Data[0:3])
copy(returner.Data[0:3], res) // copy (dst, src)
return returner, nil
}

Expand All @@ -34,4 +34,4 @@ func (_ ByteColor2ColorCode) ToMqtt(input can.Frame) ([]byte, error) {
}
colorstring := hex.EncodeToString(input.Data[0:3])
return []byte("#" + colorstring), nil
}
}

0 comments on commit 7424abb

Please sign in to comment.