When the string is empty, the program creates a zero-length VLA which is undefined behavior. Instead, always allocate an extra byte as though accounting for the null terminator in the original string. This error is caught by UBSan while running the tests.
I did not take time to report this upstream (to @Rostepher) because it looks to be abandoned.
When the string is empty, the program creates a zero-length VLA which is undefined behavior. Instead, always allocate an extra byte as though accounting for the null terminator in the original string. This error is caught by UBSan while running the tests.
I did not take time to report this upstream (to @Rostepher) because it looks to be abandoned.