Closed KakCAT closed 6 years ago
Another issue with InputText. Strings do weird things. In example, I have 2 objects with a name. In example, 'near' and 'far'
When I switch between those objects the name changes ok with near, but instead of far prints farr. I think the final (\0) is not being copied in CopyStrBuff
-> memcpy(target, linkStr, strlen(linkStr)+1);
Both of these are fixed now.
Closing now, haven't noticed anything else with strings.
Just hit me, you probably have unmanaged code debugging turned off in your project - that's probably why the exception was of the uselessly terrifying variety. Not worth turning it on unless you're fiddling in the guts of the wrapper.
I'm mulling over exception raising, leaning towards keeping the API tolerant of garbage in (it's GUI, you're going to see garbage if you put it in).
sorry for the delay, I took a break.
Yes, it's possible that the problem came from the unmanaged code debugging, as I switched it on in order to find the error. I probably didn't switch it off again.
Hi,
using (in example) ImGuiCli.InputText ("Name",ref objName); , being objName null crashes trying to copy the string. I suppose it would be better to throw an exception when this happens, otherwise a very scary error message about memory protection appears :)
(being c# and the string passed as a ref, I suppose the best way to react would be to maintain the string as null, until a key is typed, then creating a brand new string, but I'm not up to date of the internals of the lib, so I don't know if this is possible)