diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/stringhelp.c | 10 | ||||
-rw-r--r-- | common/stringhelp.h | 4 | ||||
-rw-r--r-- | common/t-stringhelp.c | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/common/stringhelp.c b/common/stringhelp.c index d7bb6bc37..a324bfbbc 100644 --- a/common/stringhelp.c +++ b/common/stringhelp.c @@ -1363,10 +1363,11 @@ strtokenize (const char *string, const char *delim) * foo (fields[1]); */ int -split_fields (char *string, char **array, int arraysize) +split_fields (char *string, const char **array, int arraysize) { int n = 0; - char *p, *pend; + const char *p; + char *pend; for (p = string; *p == ' '; p++) ; @@ -1401,10 +1402,11 @@ split_fields (char *string, char **array, int arraysize) * foo (fields[1]); */ int -split_fields_colon (char *string, char **array, int arraysize) +split_fields_colon (char *string, const char **array, int arraysize) { int n = 0; - char *p, *pend; + const char *p; + char *pend; p = string; do diff --git a/common/stringhelp.h b/common/stringhelp.h index 42bb19aaf..c5f252bbc 100644 --- a/common/stringhelp.h +++ b/common/stringhelp.h @@ -151,11 +151,11 @@ char **strtokenize (const char *string, const char *delim); /* Split STRING into space delimited fields and store them in the * provided ARRAY. */ -int split_fields (char *string, char **array, int arraysize); +int split_fields (char *string, const char **array, int arraysize); /* Split STRING into colon delimited fields and store them in the * provided ARRAY. */ -int split_fields_colon (char *string, char **array, int arraysize); +int split_fields_colon (char *string, const char **array, int arraysize); /* Return True if MYVERSION is greater or equal than REQ_VERSION. */ int compare_version_strings (const char *my_version, const char *req_version); diff --git a/common/t-stringhelp.c b/common/t-stringhelp.c index 7c6fb8022..6f7f6f7af 100644 --- a/common/t-stringhelp.c +++ b/common/t-stringhelp.c @@ -717,7 +717,7 @@ test_split_fields (void) }; int tidx; - char *fields[10]; + const char *fields[10]; int field_count_expected, nfields, field_count, i; char *s2; @@ -792,7 +792,7 @@ test_split_fields_colon (void) }; int tidx; - char *fields[10]; + const char *fields[10]; int field_count_expected, nfields, field_count, i; char *s2; |