-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
C string gets corrupted when passed to the TextCommand handler #53
Comments
Try and null terminate your strings. This worked for me implementing a renderer in GDI
or since you are using C++ try a std::string and somestring.c_str() to retrieve the char* I think it is indeed reading into the next byte and not terminating properly, I think this might how GDI (and maybe cairo?) are handling string termination. |
I haven't had a chance to test this yet, but something tells me that'll do it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm playing around with the demo program, and am noticing that the text rendering function receives a corrupt copy of the text to print. I've also noticed that the source it receives each time is different, meaning it's being corrupted along the way. It's received correctly in the
text_width
function, but I can't find where it could possibly become changed.In short, my code is this:
I can't seem to find the source of the issue. My guess was some sort of memory overwriting, but I removed all memory management calls, and still got the same result.
Some details:
The text was updated successfully, but these errors were encountered: