changeset 15586:d059cfbb62ae

Patch from Richard 'wabz' Nelson. This fixes some possible crashes/exploits.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 08 Feb 2007 22:10:30 +0000
parents 9cbf44d3c0f9
children d07c1e2e0496
files console/libgnt/gntbox.c console/libgnt/gntbutton.c console/libgnt/gntcheckbox.c console/libgnt/gntcombobox.c console/libgnt/gntlabel.c console/libgnt/gnttree.c
diffstat 6 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/console/libgnt/gntbox.c	Thu Feb 08 12:35:14 2007 +0000
+++ b/console/libgnt/gntbox.c	Thu Feb 08 22:10:30 2007 +0000
@@ -62,7 +62,7 @@
 		else
 			wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE_D));
 		mvwaddch(widget->window, 0, pos-1, ACS_RTEE | COLOR_PAIR(GNT_COLOR_NORMAL));
-		mvwprintw(widget->window, 0, pos, title);
+		mvwaddstr(widget->window, 0, pos, title);
 		mvwaddch(widget->window, 0, right, ACS_LTEE | COLOR_PAIR(GNT_COLOR_NORMAL));
 		g_free(title);
 	}
--- a/console/libgnt/gntbutton.c	Thu Feb 08 12:35:14 2007 +0000
+++ b/console/libgnt/gntbutton.c	Thu Feb 08 22:10:30 2007 +0000
@@ -22,7 +22,7 @@
 		type = GNT_COLOR_NORMAL;
 	
 	wbkgdset(widget->window, '\0' | COLOR_PAIR(type));
-	mvwprintw(widget->window, 1, 2, button->priv->text);
+	mvwaddstr(widget->window, 1, 2, button->priv->text);
 
 	GNTDEBUG;
 }
--- a/console/libgnt/gntcheckbox.c	Thu Feb 08 12:35:14 2007 +0000
+++ b/console/libgnt/gntcheckbox.c	Thu Feb 08 22:10:30 2007 +0000
@@ -24,11 +24,11 @@
 	wbkgdset(widget->window, '\0' | COLOR_PAIR(type));
 
 	text = g_strdup_printf("[%c]", cb->checked ? 'X' : ' ');
-	mvwprintw(widget->window, 0, 0, text);
+	mvwaddstr(widget->window, 0, 0, text);
 	g_free(text);
 
 	wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL));
-	mvwprintw(widget->window, 0, 4, GNT_BUTTON(cb)->priv->text);
+	mvwaddstr(widget->window, 0, 4, GNT_BUTTON(cb)->priv->text);
 	
 	GNTDEBUG;
 }
--- a/console/libgnt/gntcombobox.c	Thu Feb 08 12:35:14 2007 +0000
+++ b/console/libgnt/gntcombobox.c	Thu Feb 08 22:10:30 2007 +0000
@@ -56,7 +56,7 @@
 	s = (char*)gnt_util_onscreen_width_to_pointer(text, widget->priv.width - 4, &len);
 	*s = '\0';
 
-	mvwprintw(widget->window, 1, 1, text);
+	mvwaddstr(widget->window, 1, 1, text);
 	whline(widget->window, ' ' | COLOR_PAIR(type), widget->priv.width - 4 - len);
 	mvwaddch(widget->window, 1, widget->priv.width - 3, ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL));
 	mvwaddch(widget->window, 1, widget->priv.width - 2, ACS_DARROW | COLOR_PAIR(GNT_COLOR_NORMAL));
--- a/console/libgnt/gntlabel.c	Thu Feb 08 12:35:14 2007 +0000
+++ b/console/libgnt/gntlabel.c	Thu Feb 08 22:10:30 2007 +0000
@@ -24,7 +24,7 @@
 	chtype flag = gnt_text_format_flag_to_chtype(label->flags);
 
 	wbkgdset(widget->window, '\0' | flag);
-	mvwprintw(widget->window, 0, 0, label->text);
+	mvwaddstr(widget->window, 0, 0, label->text);
 
 	GNTDEBUG;
 }
--- a/console/libgnt/gnttree.c	Thu Feb 08 12:35:14 2007 +0000
+++ b/console/libgnt/gnttree.c	Thu Feb 08 22:10:30 2007 +0000
@@ -330,7 +330,7 @@
 		
 		for (i = 0; i < tree->ncol; i++)
 		{
-			mvwprintw(widget->window, pos, x + i, tree->columns[i].title);
+			mvwaddstr(widget->window, pos, x + i, tree->columns[i].title);
 			x += tree->columns[i].width;
 		}
 		if (pos)
@@ -409,7 +409,7 @@
 		}
 
 		wbkgdset(widget->window, '\0' | attr);
-		mvwprintw(widget->window, i, pos, str);
+		mvwaddstr(widget->window, i, pos, str);
 		whline(widget->window, ' ', scrcol - wr);
 		tree->bottom = row;
 		g_free(str);