MochiLibraries / Mochi.DearImGui

Automatically generated low-level C# bindings for Dear ImGui
MIT License
26 stars 8 forks source link

`Text("")` results in a crash because the format string is null #1

Closed PathogenDavid closed 2 years ago

PathogenDavid commented 2 years ago

Because DearImGuiInterpolatedStringHandler.NullTerminateAndGetString returns a span not including the null terminator, "" results in a 0-length ReadOnlySpan<byte>. This causes the byte* from the fixed statement to be null which is not correct in our case.

DearImGuiInterpolatedStringHandler.NullTerminateAndGetString should return a span which includes the null terminator.