-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't send empty string #17
Comments
I think I found the cause: SendTo calls Bytes method on packet (a osc message) Bytes method of message calls Bytes method for arguments, in this case a String https://github.com/scgolang/osc/blob/master/argument.go#L239 Bytes method of String calls ToBytes. ToBytes returns []byte{} when len(string) == 0 Then Pad doesn't append any null character (it isn't called) ToBytes is also used for msg.Address and BundleTag : Both can't be empty according to the OSC specs I think*. And a empty string is tested: From the specs: osc string = A sequence of non-null ASCII characters followed by a null, followed by 0-3 additional null characters ( Looking at the gosc library, it checks if a string has "\x00" as suffix and adds it when it doesn't have any, as is the case with a empty string. I think something similar is done in the go-osc library:
|
Sending a empty string doesn't seems to work using osc.String("")
Error 9912
https://github.com/radarsat1/liblo/blob/cb6f43da7cc137a2a64f129cdbb54638658a0d30/lo/lo_errors.h#L35
#define LO_EINVALIDARG 9912
The text was updated successfully, but these errors were encountered: