diff --git a/src/config/options.c b/src/config/options.c index 27ab432e7..d9aaece35 100644 --- a/src/config/options.c +++ b/src/config/options.c @@ -187,7 +187,7 @@ get_opt_rec(struct option *tree, const 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((const char *)name, '.'))) { + if ((sep = strrchr(name, '.'))) { *sep = '\0'; tree = get_opt_rec(tree, name); diff --git a/src/cookies/cookies.c b/src/cookies/cookies.c index 522bdc045..271e74957 100644 --- a/src/cookies/cookies.c +++ b/src/cookies/cookies.c @@ -370,7 +370,7 @@ set_cookie(struct uri *uri, char *str) if (!path) return; - path_end = strrchr((const char *)path, '/'); + path_end = strrchr(path, '/'); if (path_end) path_end[0] = '\0'; break; diff --git a/src/document/html/parser/link.c b/src/document/html/parser/link.c index bd18affec..a6843ffca 100644 --- a/src/document/html/parser/link.c +++ b/src/document/html/parser/link.c @@ -606,7 +606,7 @@ html_embed(struct html_context *html_context, char *a, /* If there is no extension we want to get the default mime/type * anyway? */ - extension = strrchr((const char *)object_src, '.'); + extension = strrchr(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 4ef5d013d..57bd57c8c 100644 --- a/src/ecmascript/ecmascript.c +++ b/src/ecmascript/ecmascript.c @@ -535,7 +535,7 @@ ecmascript_set_action(char **action, char *string) done_uri(uri); mem_free(string); } else { /* relative uri */ - char *last_slash = strrchr((const char *)*action, '/'); + char *last_slash = strrchr(*action, '/'); 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 101362e40..b8c2de870 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) { - char *slash = strrchr((const char *)program.path, '/'); + char *slash = strrchr(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 98c566ccf..e9c56fb71 100644 --- a/src/main/version.c +++ b/src/main/version.c @@ -189,7 +189,7 @@ get_dyn_full_version(struct terminal *term, int more) if (!more) { int start_at = 0; - char *last_newline = strrchr((const char *)string.source, '\n'); + char *last_newline = strrchr(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 947617257..61caf0509 100644 --- a/src/mime/mime.c +++ b/src/mime/mime.c @@ -104,7 +104,7 @@ static inline char * check_extension_type(char *extension) { /* Trim the extension so only last . is used. */ - char *trimmed = strrchr((const char *)extension, '.'); + char *trimmed = strrchr(extension, '.'); struct mime_handler *handler; char *content_type; @@ -133,7 +133,7 @@ check_encoding_type(char *extension) { enum stream_encoding encoding = guess_encoding(extension); const char *const *extension_list; - char *last_extension = strrchr((const char *)extension, '.'); + char *last_extension = strrchr(extension, '.'); if (encoding == ENCODING_NONE || !last_extension) return NULL; diff --git a/src/osdep/win32/overrides.c b/src/osdep/win32/overrides.c index 20af76f87..88fc9e3f9 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((const char *)buf,'\n')) != NULL && (p - buf) >= 2) + if ((p = strrchr(buf,'\n')) != NULL && (p - buf) >= 2) *p = '\0'; - if ((p = strrchr((const char *)buf,'\r')) != NULL && (p - buf) >= 1) + if ((p = strrchr(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 319732df0..fa78d69ee 100644 --- a/src/protocol/file/cgi.c +++ b/src/protocol/file/cgi.c @@ -347,7 +347,7 @@ execute_cgi(struct connection *conn) return 1; } - last_slash = strrchr((const char *)script, '/'); + last_slash = strrchr(script, '/'); if (last_slash++) { unsigned char storage; int res; diff --git a/src/viewer/text/form.c b/src/viewer/text/form.c index 951fccdac..e371b0780 100644 --- a/src/viewer/text/form.c +++ b/src/viewer/text/form.c @@ -1029,7 +1029,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((const char *)sv->value, '.'); + extension = strrchr(sv->value, '.'); if (extension) { char *type = get_extension_content_type(extension);