summaryrefslogtreecommitdiffstats
path: root/lib/getopt.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2013-02-07 22:31:39 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-11 20:57:34 +0100
commit9d90e219c175ba5dde2170e34d83093ef3a99101 (patch)
tree8d21d768689ff23d9e41344d4e5b3a3439d13cb4 /lib/getopt.c
parentc7a9534359ad0ea59ef8d985d03cc4bcc771795d (diff)
downloadbarebox-9d90e219c175ba5dde2170e34d83093ef3a99101.tar.gz
barebox-9d90e219c175ba5dde2170e34d83093ef3a99101.tar.xz
getopt: change optstring to const char*
Change getopt optstring parameter type to const char *. Also change type to const char * of tmp variable which pointed to optstring. This will only handle readonly. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/getopt.c')
-rw-r--r--lib/getopt.c4
1 files changed, 2 insertions, 2 deletions
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);