From 7e92827db5195a5b6afc110d0152eb2deef75638 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Thu, 28 Jan 2010 23:44:19 -0500 Subject: [PATCH] libustcomm: change char * to const char * where relevant --- libustcomm/ustcomm.c | 16 ++++++++-------- libustcomm/ustcomm.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libustcomm/ustcomm.c b/libustcomm/ustcomm.c index 6ddd6d8..fd5e360 100644 --- a/libustcomm/ustcomm.c +++ b/libustcomm/ustcomm.c @@ -612,7 +612,7 @@ void ustcomm_fini_app(struct ustcomm_app *handle) } } -static char *find_tok(char *str) +static const char *find_tok(const char *str) { while(*str == ' ') { str++; @@ -624,7 +624,7 @@ static char *find_tok(char *str) return str; } -static char *find_sep(char *str) +static const char *find_sep(const char *str) { while(*str != ' ') { str++; @@ -636,11 +636,11 @@ static char *find_sep(char *str) return str; } -int nth_token_is(char *str, char *token, int tok_no) +int nth_token_is(const char *str, const char *token, int tok_no) { int i; - char *start; - char *end; + const char *start; + const char *end; for(i=0; i<=tok_no; i++) { str = find_tok(str); @@ -665,12 +665,12 @@ int nth_token_is(char *str, char *token, int tok_no) return 1; } -char *nth_token(char *str, int tok_no) +char *nth_token(const char *str, int tok_no) { static char *retval = NULL; int i; - char *start; - char *end; + const char *start; + const char *end; for(i=0; i<=tok_no; i++) { str = find_tok(str); diff --git a/libustcomm/ustcomm.h b/libustcomm/ustcomm.h index 564ecac..2508838 100644 --- a/libustcomm/ustcomm.h +++ b/libustcomm/ustcomm.h @@ -74,9 +74,9 @@ extern int ustcomm_send_reply(struct ustcomm_server *server, char *msg, struct u extern int ustcomm_disconnect(struct ustcomm_connection *conn); extern int ustcomm_close_all_connections(struct ustcomm_server *server); -extern int nth_token_is(char *str, char *token, int tok_no); +extern int nth_token_is(const char *str, const char *token, int tok_no); -extern char *nth_token(char *str, int tok_no); +extern char *nth_token(const char *str, int tok_no); extern int pid_is_online(pid_t); -- 2.34.1