aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-12-01 20:05:49 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-12-01 20:05:49 -0800
commit1feea366ca2a1eddc966a4fabb25c731b2f8e5ca (patch)
tree9724342f68ad6355bac048969aa80dde05538f3e
parentf599239fd4c4339d5d482f9cba9c7b61b4b7cd15 (diff)
Fix for off by one error with "missing newline" code
-rw-r--r--screen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/screen.cpp b/screen.cpp
index a5a5cc82..df31ad1f 100644
--- a/screen.cpp
+++ b/screen.cpp
@@ -1338,12 +1338,12 @@ void s_reset(screen_t *s, screen_reset_mode_t mode)
abandon_line_string.reserve(screen_width);
int non_space_width = wcwidth(omitted_newline_char);
- if (screen_width > non_space_width)
+ if (screen_width >= non_space_width)
{
abandon_line_string.append(L"\x1b[7m"); //invert text ANSI escape sequence
abandon_line_string.push_back(omitted_newline_char);
abandon_line_string.append(L"\x1b[0m"); //normal text ANSI escape sequence
- abandon_line_string.append(screen_width - non_space_width - 1, L' ');
+ abandon_line_string.append(screen_width - non_space_width, L' ');
}
abandon_line_string.push_back(L'\r');
const std::string narrow_abandon_line_string = wcs2string(abandon_line_string);