[Vimprobable-users] [PATCH 3/3] fix compiler warnings: add some 'const'.
Vimprobable is a lean web browser optimised for full keyboard control
Brought to you by:
hanness
From: Steffen S. <ste...@gm...> - 2012-03-03 17:36:05
|
--- utilities.c | 4 ++-- utilities.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utilities.c b/utilities.c index 7d41867..bc70f88 100644 --- a/utilities.c +++ b/utilities.c @@ -802,7 +802,7 @@ void make_uri_handlers_list(URIHandler *uri_handlers, int length) * also todo: Will leak mem if %s is used more than once. */ void -spawn_command_on(const char* p_cmd, char* arg) { +spawn_command_on(const char* p_cmd, const char* arg) { char *argv[64], cmd[MAX_SETTING_SIZE]; strncpy(cmd, p_cmd, MAX_SETTING_SIZE); char *dynarg = NULL; @@ -819,7 +819,7 @@ spawn_command_on(const char* p_cmd, char* arg) { } gboolean -is_prefix_of(char* s, char* t) { +is_prefix_of(const char* s, const char* t) { return strlen(s) <= strlen(t) && !strncmp(s, t, strlen(s)); } diff --git a/utilities.h b/utilities.h index 67338c1..c9f0633 100644 --- a/utilities.h +++ b/utilities.h @@ -35,9 +35,9 @@ char *find_uri_for_searchengine(const char *handle); void make_searchengines_list(Searchengine *searchengines, int length); void make_uri_handlers_list(URIHandler *uri_handlers, int length); void make_file_handlers_list(FileHandler *file_handlers, int length); -void spawn_command_on(const char* p_cmd, char* arg); +void spawn_command_on(const char* p_cmd, const char* arg); gboolean open_handler(char *uri); gboolean open_file_handler(const char *dst_uri, const char* content_type); -gboolean is_prefix_of(char* s, char* t); +gboolean is_prefix_of(const char* s, const char* t); -- 1.7.9.1 |