summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/getopt.h2
-rw-r--r--lib/getopt.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/getopt.h b/include/getopt.h
index f23175fb87..4f48ba8fd9 100644
--- a/include/getopt.h
+++ b/include/getopt.h
@@ -35,7 +35,7 @@ extern char *optarg;
* - options can be mixed with nonoptions (like ls /bin -R)
*/
-int getopt(int argc, char *argv[], char *optstring);
+int getopt(int argc, char *argv[], const char *optstring);
struct getopt_context {
int opterr;
diff --git a/lib/getopt.c b/lib/getopt.c
index ead9150994..fd12a886ec 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -56,10 +56,10 @@ void getopt_context_restore(struct getopt_context *gc)
}
EXPORT_SYMBOL(getopt_context_restore);
-int getopt(int argc, char *argv[], char *optstring)
+int getopt(int argc, char *argv[], const char *optstring)
{
char curopt; /* current option character */
- char *curoptp; /* pointer to the current option in optstring */
+ const char *curoptp; /* pointer to the current option in optstring */
while(1) {
debug("optindex: %d nonopts: %d optind: %d\n", optindex, nonopts, optind);