[PATCH:xman 1/4] Mark string argument to PopupWarning as a const char *

Alan Coopersmith alan.coopersmith at oracle.com
Fri Jan 28 23:13:57 PST 2011


PopupWarning just copies the string into the message it displays,
via snprintf, and never writes to it.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 man.h  |    2 +-
 misc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/man.h b/man.h
index 73b17bb..d1d104c 100644
--- a/man.h
+++ b/man.h
@@ -262,7 +262,7 @@ ManpageGlobals * GetGlobals(Widget w);
 void AddCursor(Widget w, Cursor cursor);
 void ChangeLabel(Widget w, char * str);
 void OpenFile(ManpageGlobals * man_globals, FILE * file);
-void PopupWarning(ManpageGlobals * man_globals, char * string);
+void PopupWarning(ManpageGlobals * man_globals, const char * string);
 void PositionCenter(Widget widget, int x, int y, int above, int left, int v_space, int h_space);
 void PrintError(char * string);
 void RemoveGlobals(Widget w);
diff --git a/misc.c b/misc.c
index b5b9f07..cc0397e 100644
--- a/misc.c
+++ b/misc.c
@@ -90,7 +90,7 @@ PopdownWarning(Widget w, XtPointer client, XtPointer call)
 }
 
 void
-PopupWarning(ManpageGlobals * man_globals, char * string)
+PopupWarning(ManpageGlobals * man_globals, const char * string)
 {
   int n;
   Arg wargs[3];
-- 
1.7.3.2



More information about the xorg-devel mailing list