Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass length constrained mrb string to osc-bridge
When views are created on mruby strings it's possible that the string pointer points to a longer string than is visible at the ruby level. In other words strlen(s.pointer) >= s.length. By copying a string we avoid this edge case. In the UI this created a bug where it was impossible to delete characters from a long string. In ruby you'd start with a string like "foobar"\0(len 6), delete a character off the end via creating a string view which at the ruby level was "fooba", but under the hood it was represented via "fooba"r\0(len 5). This specific behavior only occurs for non-embeddable strings which in mruby's case is about roughly 27 characters (compilation flag dependent).
- Loading branch information
Just out of curiosity: what's the reason for avoiding memcpy here?