Skip to contentSkip to conversation

tab_window: null members on construction

PATCH Applied Sergey Senozhatsky 2 participants 2 messages Dec 19, 2012 – Jan 31, 2013

lore
Share & tools
lore

Sergey Senozhatsky

author
#0 lore raw

PATCH 1/1 tab_window: null members on construction

introduce tab_window ctor and null memebers during construction. show_tab() may be called before window_refresh() [which sets ypad_pos and xpad_pos to 0], causing prefresh() call with uninit win->ypad_pos, win->xpad_pos args.

Signed-off-by Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

---

 src/display.h | 8 ++++++++
 1 file changed, 8 insertions(+)
src/display.h +8 -0
index b450f8b..9af3ec0 100644
@@ -53,6 +53,14 @@ public:
 	short int xpad_pos, ypad_pos; 
 	WINDOW *win;
 
+	tab_window() {
+		cursor_pos = 0;
+		cursor_max = 0;
+		xpad_pos =0;
+		ypad_pos = 0;
+		win = NULL;
+	}
+
 	virtual void cursor_down(void) { 
 		if (cursor_pos < cursor_max ) cursor_pos++; repaint(); 
 	} ;
Applied
#1 lore raw
Quoted 32 lines · On Wed, 19 Dec 2012 19:06:52 +0300 Sergey Senozhatsky…

introduce tab_window ctor and null memebers during construction. show_tab() may be called before window_refresh() [which sets ypad_pos and xpad_pos to 0], causing prefresh() call with uninit win->ypad_pos, win->xpad_pos args.

Signed-off-by Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

---

 src/display.h | 8 ++++++++
 1 file changed, 8 insertions(+)
src/display.h +8 -0
index b450f8b..9af3ec0 100644
@@ -53,6 +53,14 @@ public:
 	short int xpad_pos, ypad_pos; 
 	WINDOW *win;
 
+	tab_window() {
+		cursor_pos = 0;
+		cursor_max = 0;
+		xpad_pos =0;
+		ypad_pos = 0;
+		win = NULL;
+	}
+
 	virtual void cursor_down(void) { 
 		if (cursor_pos < cursor_max ) cursor_pos++;
 repaint(); } ;
Quoted 4 lines

_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop

applied, thanks.

Kristen