From 6f3a65322b92afac5ae298405bf5523bf6ddb16a Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Wed, 28 Jan 2026 14:36:59 -0600 Subject: [PATCH] rework send string --- osc.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/osc.go b/osc.go index c8618c7..1fb6833 100644 --- a/osc.go +++ b/osc.go @@ -174,17 +174,13 @@ func argsToBuffer(args []OSCArg) []byte { func readOSCString(bytes []byte) (string, []byte) { //TODO(jwetzell): add error handling oscString := "" - stringFinished := false stringEndIndex := 0 - remainingBytes := []byte{} for index, byteIn := range bytes { - if !stringFinished { - if byteIn == 0 { - oscString = string(bytes[0:index]) - stringEndIndex = index + 1 - break - } + if byteIn == 0 { + oscString = string(bytes[0:index]) + stringEndIndex = index + 1 + break } } @@ -194,7 +190,7 @@ func readOSCString(bytes []byte) (string, []byte) { stringEndIndex = stringEndIndex + stringPadding } - remainingBytes = bytes[stringEndIndex:] + remainingBytes := bytes[stringEndIndex:] return oscString, remainingBytes }