[Sheepdog] [PATCH 4/9] const correctness: make short_options a const char *

Steven Dake sdake at redhat.com
Mon May 17 18:37:12 CEST 2010


getopt_long expects a const char * for third argument, not a char *.

Signed-off-by: Steven Dake <sdake at redhat.com>
---
 collie/collie.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/collie/collie.c b/collie/collie.c
index 9ea237d..d394488 100644
--- a/collie/collie.c
+++ b/collie/collie.c
@@ -971,7 +971,7 @@ static struct {
 	const char *name;
 	struct subcommand *sub;
 	struct option *lopts;
-	char *sopts;
+	const char *sopts;
 	int (*parser)(int, char *);
 	void (*help)(void);
 } commands[] = {
@@ -991,7 +991,7 @@ static struct option common_long_options[] =
 };
 
 static struct option *long_options = common_long_options;
-static char *short_options = COMMON_SHORT_OPTIONS;
+static const char *short_options = COMMON_SHORT_OPTIONS;
 static int (*command_parser)(int, char *);
 static int (*command_fn)(int, char **);
 static void (*command_help)(void);
-- 
1.6.2.5




More information about the sheepdog mailing list