Fix crashes with windows overlapping right and bottom edges of screen #168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ncurses
allows one to create, move, and resize windows to extend past the right and bottom edges of the screen. PDCurses doesn't allow you to create or move such windows. It will allow you to attempt to resize past those edges and will return a valid window, but will segfault when that window is updated; see issues #162 and #85. This patch fixes both issues.With ports supporting resizable screens, you also got crashes if the screen is shrunk such that an existing window sticks past the right or bottom edge. That's also now fixed.
The first commit simply says that when refreshing a window, stop copying data when you reach the right and bottom edges of
curscr
. (At present, there's no way I can see to get windows to go past the left or top edges.)The second commit, recognizing that such windows can now be displayed without crashing, removes the limits in
newwin()
andmvwin()
.resize_window()
, as noted above, already had no such limits.)