-
Notifications
You must be signed in to change notification settings - Fork 101
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
Bug or Feature? Secrets of the percentage sign #164
Comments
I just noticed another detail that might matter: |
Apparently int printw(const char *fmt, ...); Rust doesn't have this concept of variable-argument functions, and just exposes the fixed format string as input. But ncurses still expects percent in the string to refer to parameters, and since no such parameter is given, memory confusion ensues. Technically, |
Thanks, AlexArgoAi, will do that! And I guess I will have to do some more checks on the strings I want to print (because I just read files, so I don't know what exactly is in there). Seems there is no obvious way to check if a character is printable or not. |
In general you may want to use |
Yes, that's the hint I needed! Thanks a lot! |
I found this issue while looking for something else, but wanted to mention, there is a simple way for printw to percent-escape itself, just make it call the C |
Right, but at that point it loses the ability to use formatting, and you're just better off using |
|
Hi Jeaye
I recently ran into a segmentation fault when displaying text from a file with ncurses.
After playing around a bit I found out that percentage signs in the strings to be displayed caused this behaviour.
Now I'm wondering if this is a feature of which I haven't heard before, or if it is a bug.
If it's a feature, the could you please point me to some doc I can study?
I found the following funny output:
Here's an example to reproduce (uncommenting the 'killer' line leads to segmenation fault):
This produces the following output:
(I run all that on Fedora Linux)
Kind regards
Peter
The text was updated successfully, but these errors were encountered: