summaryrefslogtreecommitdiff
path: root/xauth.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-28 19:57:15 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-28 19:57:15 -0700
commitee3e046dfd84cda1588eef155c7e7c36df9bf5f4 (patch)
treea01da219178935fef20c9b34bfee37bd37bfb345 /xauth.c
parent7f7f8cd60795c9503156950d518caa04b30a94a2 (diff)
downloadxorg-app-xauth-ee3e046dfd84cda1588eef155c7e7c36df9bf5f4.tar.gz
Add const attributes to fix gcc -Wwrite-strings warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xauth.c')
-rw-r--r--xauth.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/xauth.c b/xauth.c
index 7a6a522..13f6ace 100644
--- a/xauth.c
+++ b/xauth.c
@@ -38,7 +38,7 @@ in this Software without prior written authorization from The Open Group.
/*
* global data
*/
-char *ProgramName; /* argv[0], set at top of main() */
+const char *ProgramName; /* argv[0], set at top of main() */
int verbose = -1; /* print certain messages */
Bool ignore_locks = False; /* for error recovery */
Bool break_locks = False; /* for error recovery */
@@ -48,10 +48,10 @@ Bool no_name_lookups = False; /* show addresses instead of names */
* local data
*/
-static char *authfilename = NULL; /* filename of cookie file */
-static char *defcmds[] = { "source", "-", NULL }; /* default command */
+static const char *authfilename = NULL; /* filename of cookie file */
+static const char *defcmds[] = { "source", "-", NULL }; /* default command */
static int ndefcmds = 2;
-static char *defsource = "(stdin)";
+static const char *defsource = "(stdin)";
/*
* utility routines
@@ -59,7 +59,7 @@ static char *defsource = "(stdin)";
static void
usage(void)
{
- static char *prefixmsg[] = {
+ static const char *prefixmsg[] = {
"",
"where options include:",
" -f authfilename name of authority file to use",
@@ -71,12 +71,12 @@ usage(void)
"and commands have the following syntax:",
"",
NULL };
- static char *suffixmsg[] = {
+ static const char *suffixmsg[] = {
"A dash may be used with the \"merge\" and \"source\" to read from the",
"standard input. Commands beginning with \"n\" use numeric format.",
"",
NULL };
- char **msg;
+ const char **msg;
fprintf (stderr, "usage: %s [-options ...] [command arg ...]\n",
ProgramName);
@@ -96,21 +96,21 @@ NULL };
* The main routine - parses command line and calls action procedures
*/
int
-main(int argc, char *argv[])
+main(int argc, const char *argv[])
{
int i;
- char *sourcename = defsource;
- char **arglist = defcmds;
+ const char *sourcename = defsource;
+ const char **arglist = defcmds;
int nargs = ndefcmds;
int status;
ProgramName = argv[0];
for (i = 1; i < argc; i++) {
- char *arg = argv[i];
+ const char *arg = argv[i];
if (arg[0] == '-') {
- char *flag;
+ const char *flag;
for (flag = (arg + 1); *flag; flag++) {
switch (*flag) {