diff --git a/src/config/options.c b/src/config/options.c index 080ead3f..175d09ac 100644 --- a/src/config/options.c +++ b/src/config/options.c @@ -181,7 +181,7 @@ get_opt_rec(struct option *tree, const unsigned char *name_) /* We iteratively call get_opt_rec() each for path_elements-1, getting * appropriate tree for it and then resolving [path_elements]. */ - if ((sep = strrchr(name, '.'))) { + if ((sep = strrchr((const char *)name, '.'))) { *sep = '\0'; tree = get_opt_rec(tree, name); diff --git a/src/cookies/cookies.c b/src/cookies/cookies.c index 48ced773..19d6cf35 100644 --- a/src/cookies/cookies.c +++ b/src/cookies/cookies.c @@ -372,7 +372,7 @@ set_cookie(struct uri *uri, unsigned char *str) if (!path) return; - path_end = strrchr(path, '/'); + path_end = strrchr((const char *)path, '/'); if (path_end) path_end[1] = '\0'; break; diff --git a/src/document/html/parser/link.c b/src/document/html/parser/link.c index 4c14a4c1..7508c95e 100644 --- a/src/document/html/parser/link.c +++ b/src/document/html/parser/link.c @@ -539,7 +539,7 @@ html_embed(struct html_context *html_context, unsigned char *a, /* If there is no extension we want to get the default mime/type * anyway? */ - extension = strrchr(object_src, '.'); + extension = strrchr((const char *)object_src, '.'); if (!extension) extension = object_src; type = get_extension_content_type(extension); diff --git a/src/ecmascript/ecmascript.c b/src/ecmascript/ecmascript.c index e493b6f4..5b48abb2 100644 --- a/src/ecmascript/ecmascript.c +++ b/src/ecmascript/ecmascript.c @@ -283,7 +283,7 @@ ecmascript_set_action(unsigned char **action, unsigned char *string) done_uri(uri); mem_free(string); } else { /* relative uri */ - unsigned char *last_slash = strrchr(*action, '/'); + unsigned char *last_slash = strrchr((const char *)*action, '/'); unsigned char *new_action; if (last_slash) *(last_slash + 1) = '\0'; diff --git a/src/intl/gettext/loadmsgcat.c b/src/intl/gettext/loadmsgcat.c index 82f6f2fb..3ad37cff 100644 --- a/src/intl/gettext/loadmsgcat.c +++ b/src/intl/gettext/loadmsgcat.c @@ -216,7 +216,7 @@ _nl_free_domain_conv(struct loaded_domain *domain) static struct string * add_filename_to_string(struct string *str, struct loaded_l10nfile *domain_file) { - unsigned char *slash = strrchr(program.path, '/'); + unsigned char *slash = strrchr((const char *)program.path, '/'); size_t dirnamelen = (slash ? slash - program.path + 1 : 0); /* Check if elinks is being run from the source tree. */ diff --git a/src/main/version.c b/src/main/version.c index 8ef7ca8b..79fe6c52 100644 --- a/src/main/version.c +++ b/src/main/version.c @@ -154,7 +154,7 @@ get_dyn_full_version(struct terminal *term, int more) if (!more) { int start_at = 0; - unsigned char *last_newline = strrchr(string.source, '\n'); + unsigned char *last_newline = strrchr((const char *)string.source, '\n'); if (last_newline) { start_at = last_newline - string.source + 1; diff --git a/src/mime/mime.c b/src/mime/mime.c index f808ba86..a429cf04 100644 --- a/src/mime/mime.c +++ b/src/mime/mime.c @@ -104,7 +104,7 @@ static inline unsigned char * check_extension_type(unsigned char *extension) { /* Trim the extension so only last . is used. */ - unsigned char *trimmed = strrchr(extension, '.'); + unsigned char *trimmed = strrchr((const char *)extension, '.'); struct mime_handler *handler; unsigned char *content_type; @@ -133,7 +133,7 @@ check_encoding_type(unsigned char *extension) { enum stream_encoding encoding = guess_encoding(extension); const unsigned char *const *extension_list; - unsigned char *last_extension = strrchr(extension, '.'); + unsigned char *last_extension = strrchr((const char *)extension, '.'); if (encoding == ENCODING_NONE || !last_extension) return NULL; diff --git a/src/osdep/win32/overrides.c b/src/osdep/win32/overrides.c index be04991d..803a2654 100644 --- a/src/osdep/win32/overrides.c +++ b/src/osdep/win32/overrides.c @@ -906,9 +906,9 @@ win32_strerror(int err) } /* strip trailing '\r\n' or '\n'. */ - if ((p = strrchr(buf,'\n')) != NULL && (p - buf) >= 2) + if ((p = strrchr((const char *)buf,'\n')) != NULL && (p - buf) >= 2) *p = '\0'; - if ((p = strrchr(buf,'\r')) != NULL && (p - buf) >= 1) + if ((p = strrchr((const char *)buf,'\r')) != NULL && (p - buf) >= 1) *p = '\0'; return buf; diff --git a/src/protocol/file/cgi.c b/src/protocol/file/cgi.c index da30d6b5..29d69c5b 100644 --- a/src/protocol/file/cgi.c +++ b/src/protocol/file/cgi.c @@ -328,7 +328,7 @@ execute_cgi(struct connection *conn) return 1; } - last_slash = strrchr(script, '/'); + last_slash = strrchr((const char *)script, '/'); if (last_slash++) { unsigned char storage; int res; diff --git a/src/viewer/text/form.c b/src/viewer/text/form.c index c57ae113..92ef20ea 100644 --- a/src/viewer/text/form.c +++ b/src/viewer/text/form.c @@ -1009,7 +1009,7 @@ encode_multipart(struct session *ses, LIST_OF(struct submitted_value) *l, add_char_to_string(data, '"'); /* Add a Content-Type header if the type is configured */ - extension = strrchr(sv->value, '.'); + extension = strrchr((const char *)sv->value, '.'); if (extension) { unsigned char *type = get_extension_content_type(extension);