Fixed a bug for non-full-width line display.
authorFrancois Fleuret <francois@fleuret.org>
Fri, 17 Feb 2012 22:59:15 +0000 (23:59 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Fri, 17 Feb 2012 22:59:15 +0000 (23:59 +0100)
selector.c

index 24ad55d..2d81071 100644 (file)
@@ -764,9 +764,10 @@ void update_screen(int *current_focus_line, int *displayed_focus_line,
               addnstr("\\", 1);
               attroff(attr_focus_line);
             } else {
-              buffer[k++] = '\n';
-              buffer[k++] = '\0';
-
+              if(k < console_width) {
+                buffer[k++] = '\n';
+                buffer[k++] = '\0';
+              }
               print_string_with_switches(buffer, k,
                                          nb_switches / 2, switches);
             }