mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Explicit cast to (const char *) for strchr function (C++)
This commit is contained in:
parent
89387e3679
commit
52d6f37c8e
@ -349,7 +349,7 @@ select_button_by_key(struct dialog_data *dlg_data)
|
|||||||
|
|
||||||
#ifdef CONFIG_UTF8
|
#ifdef CONFIG_UTF8
|
||||||
hk_char = cp_to_unicode(codepage, &hk_ptr,
|
hk_char = cp_to_unicode(codepage, &hk_ptr,
|
||||||
strchr(hk_ptr, '\0'));
|
strchr((const char *)hk_ptr, '\0'));
|
||||||
/* hk_char can be UCS_NO_CHAR only if the text of the
|
/* hk_char can be UCS_NO_CHAR only if the text of the
|
||||||
* widget is not in the expected codepage. */
|
* widget is not in the expected codepage. */
|
||||||
assert(hk_char != UCS_NO_CHAR);
|
assert(hk_char != UCS_NO_CHAR);
|
||||||
|
@ -25,7 +25,7 @@ static inline int
|
|||||||
find_hotkey_pos(unsigned char *text)
|
find_hotkey_pos(unsigned char *text)
|
||||||
{
|
{
|
||||||
if (text && *text) {
|
if (text && *text) {
|
||||||
unsigned char *p = strchr(text, '~');
|
unsigned char *p = strchr((const char *)text, '~');
|
||||||
|
|
||||||
if (p) return (int) (p - text) + 1;
|
if (p) return (int) (p - text) + 1;
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ check_hotkeys_common(struct menu *menu, term_event_char_T hotkey, struct termina
|
|||||||
/* Compare @key to the character to which @text points. */
|
/* Compare @key to the character to which @text points. */
|
||||||
#ifdef CONFIG_UTF8
|
#ifdef CONFIG_UTF8
|
||||||
items_hotkey = cp_to_unicode(codepage, &text,
|
items_hotkey = cp_to_unicode(codepage, &text,
|
||||||
strchr(text, '\0'));
|
strchr((const char *)text, '\0'));
|
||||||
/* items_hotkey can be UCS_NO_CHAR only if the text of
|
/* items_hotkey can be UCS_NO_CHAR only if the text of
|
||||||
* the menu item is not in the expected codepage. */
|
* the menu item is not in the expected codepage. */
|
||||||
assert(items_hotkey != UCS_NO_CHAR);
|
assert(items_hotkey != UCS_NO_CHAR);
|
||||||
|
@ -477,7 +477,7 @@ kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
|||||||
#ifdef CONFIG_UTF8
|
#ifdef CONFIG_UTF8
|
||||||
if (term->utf8_cp) {
|
if (term->utf8_cp) {
|
||||||
unsigned char *next = widget_data->cdata + widget_data->info.field.cpos;
|
unsigned char *next = widget_data->cdata + widget_data->info.field.cpos;
|
||||||
unsigned char *end = strchr(next, '\0');
|
unsigned char *end = strchr((const char *)next, '\0');
|
||||||
|
|
||||||
utf8_to_unicode(&next, end);
|
utf8_to_unicode(&next, end);
|
||||||
widget_data->info.field.cpos = (int)(next - widget_data->cdata);
|
widget_data->info.field.cpos = (int)(next - widget_data->cdata);
|
||||||
|
@ -456,7 +456,7 @@ draw_menu_left_text_hk(struct terminal *term, unsigned char *text,
|
|||||||
|
|
||||||
#ifdef CONFIG_UTF8
|
#ifdef CONFIG_UTF8
|
||||||
utf8:
|
utf8:
|
||||||
end = strchr(text, '\0');
|
end = strchr((const char *)text, '\0');
|
||||||
text2 = text;
|
text2 = text;
|
||||||
for (x = 0; x - !!hk_state < w && *text2; x++) {
|
for (x = 0; x - !!hk_state < w && *text2; x++) {
|
||||||
unicode_val_T data;
|
unicode_val_T data;
|
||||||
@ -795,7 +795,7 @@ search_menu_item(struct menu_item *item, unsigned char *buffer,
|
|||||||
text = stracpy(text);
|
text = stracpy(text);
|
||||||
if (!text) return 0;
|
if (!text) return 0;
|
||||||
|
|
||||||
match = strchr(text, '~');
|
match = strchr((const char *)text, '~');
|
||||||
if (match)
|
if (match)
|
||||||
memmove(match, match + 1, strlen(match));
|
memmove(match, match + 1, strlen(match));
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ read_bookmarks_default(FILE *f)
|
|||||||
|
|
||||||
/* Load URL. */
|
/* Load URL. */
|
||||||
|
|
||||||
url = strchr(in_buffer, '\t');
|
url = strchr((const char *)in_buffer, '\t');
|
||||||
|
|
||||||
/* If separator is not found, or title is empty or too long,
|
/* If separator is not found, or title is empty or too long,
|
||||||
* skip that line. */
|
* skip that line. */
|
||||||
@ -59,7 +59,7 @@ read_bookmarks_default(FILE *f)
|
|||||||
|
|
||||||
/* Load depth. */
|
/* Load depth. */
|
||||||
|
|
||||||
depth_str = strchr(url, '\t');
|
depth_str = strchr((const char *)url, '\t');
|
||||||
if (depth_str && depth_str - url > MAX_STR_LEN - 1)
|
if (depth_str && depth_str - url > MAX_STR_LEN - 1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ read_bookmarks_default(FILE *f)
|
|||||||
|
|
||||||
/* Load flags. */
|
/* Load flags. */
|
||||||
|
|
||||||
flags = strchr(depth_str, '\t');
|
flags = strchr((const char *)depth_str, '\t');
|
||||||
if (flags) {
|
if (flags) {
|
||||||
*flags = '\0';
|
*flags = '\0';
|
||||||
flags++;
|
flags++;
|
||||||
@ -82,7 +82,7 @@ read_bookmarks_default(FILE *f)
|
|||||||
|
|
||||||
/* Load EOLN. */
|
/* Load EOLN. */
|
||||||
|
|
||||||
line_end = strchr(flags ? flags : depth_str, '\n');
|
line_end = strchr((const char *)(flags ? flags : depth_str), '\n');
|
||||||
if (!line_end)
|
if (!line_end)
|
||||||
continue;
|
continue;
|
||||||
*line_end = '\0';
|
*line_end = '\0';
|
||||||
|
2
src/cache/cache.c
vendored
2
src/cache/cache.c
vendored
@ -754,7 +754,7 @@ redirect_cache(struct cache_entry *cached, unsigned char *location,
|
|||||||
|
|
||||||
/* To be certain we don't append post data twice in some
|
/* To be certain we don't append post data twice in some
|
||||||
* conditions... --Zas */
|
* conditions... --Zas */
|
||||||
assert(!strchr(uristring, POST_CHAR));
|
assert(!strchr((const char *)uristring, POST_CHAR));
|
||||||
|
|
||||||
add_to_strn(&uristring, cached->uri->post - 1);
|
add_to_strn(&uristring, cached->uri->post - 1);
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,8 @@ parse_options_(int argc, unsigned char *argv[], struct option *opt,
|
|||||||
/* Substitute '-' by '_'. This helps
|
/* Substitute '-' by '_'. This helps
|
||||||
* compatibility with that very wicked browser
|
* compatibility with that very wicked browser
|
||||||
* called 'lynx'. */
|
* called 'lynx'. */
|
||||||
for (pos = strchr(oname, '_'); pos;
|
for (pos = strchr((const char *)oname, '_'); pos;
|
||||||
pos = strchr(pos, '_'))
|
pos = strchr((const char *)pos, '_'))
|
||||||
*pos = '-';
|
*pos = '-';
|
||||||
option = get_opt_rec(opt, oname);
|
option = get_opt_rec(opt, oname);
|
||||||
oname--;
|
oname--;
|
||||||
@ -272,7 +272,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
|
|||||||
|
|
||||||
if (*start == '"') {
|
if (*start == '"') {
|
||||||
end = ++start;
|
end = ++start;
|
||||||
while ((end = strchr(end, '"'))) {
|
while ((end = strchr((const char *)end, '"'))) {
|
||||||
/* Treat "" inside quoted arg as ". */
|
/* Treat "" inside quoted arg as ". */
|
||||||
if (end[1] != '"')
|
if (end[1] != '"')
|
||||||
break;
|
break;
|
||||||
@ -300,7 +300,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
|
|||||||
*start = 0;
|
*start = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
end = strchr(start, ',');
|
end = strchr((const char *)start, ',');
|
||||||
if (!end) {
|
if (!end) {
|
||||||
end = start + strlen(start);
|
end = start + strlen(start);
|
||||||
arg = end;
|
arg = end;
|
||||||
@ -646,7 +646,7 @@ print_short_help(void)
|
|||||||
static unsigned char *
|
static unsigned char *
|
||||||
printhelp_cmd(struct option *option, unsigned char ***argv, int *argc)
|
printhelp_cmd(struct option *option, unsigned char ***argv, int *argc)
|
||||||
{
|
{
|
||||||
unsigned char *lineend = strchr(full_static_version, '\n');
|
unsigned char *lineend = strchr((const char *)full_static_version, '\n');
|
||||||
|
|
||||||
if (lineend) *lineend = '\0';
|
if (lineend) *lineend = '\0';
|
||||||
|
|
||||||
|
@ -728,10 +728,10 @@ load_cookies(void) {
|
|||||||
|
|
||||||
/* First find all members. */
|
/* First find all members. */
|
||||||
for (member = NAME; member < MEMBERS; member++, q = ++p) {
|
for (member = NAME; member < MEMBERS; member++, q = ++p) {
|
||||||
p = strchr(q, '\t');
|
p = strchr((const char *)q, '\t');
|
||||||
if (!p) {
|
if (!p) {
|
||||||
if (member + 1 != MEMBERS) break; /* last field ? */
|
if (member + 1 != MEMBERS) break; /* last field ? */
|
||||||
p = strchr(q, '\n');
|
p = strchr((const char *)q, '\n');
|
||||||
if (!p) break;
|
if (!p) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -434,7 +434,7 @@ extract_rows_or_cols_values(unsigned char *str, int max_value, int pixels_per_ch
|
|||||||
values[values_count++] = val;
|
values[values_count++] = val;
|
||||||
|
|
||||||
/* Check for next field if any. */
|
/* Check for next field if any. */
|
||||||
tmp_str = strchr(str, ',');
|
tmp_str = strchr((const char *)str, ',');
|
||||||
if (!tmp_str) break; /* It was the last field. */
|
if (!tmp_str) break; /* It was the last field. */
|
||||||
|
|
||||||
str = tmp_str + 1;
|
str = tmp_str + 1;
|
||||||
|
@ -94,11 +94,11 @@ html_parse_meta_refresh(const unsigned char *content,
|
|||||||
if (*url_begin == '"' || *url_begin == '\'') {
|
if (*url_begin == '"' || *url_begin == '\'') {
|
||||||
unsigned char quote = *url_begin++;
|
unsigned char quote = *url_begin++;
|
||||||
|
|
||||||
url_end = strchr(url_begin, quote);
|
url_end = strchr((const char *)url_begin, quote);
|
||||||
if (url_end == NULL)
|
if (url_end == NULL)
|
||||||
url_end = strchr(url_begin, '\0');
|
url_end = strchr((const char *)url_begin, '\0');
|
||||||
} else {
|
} else {
|
||||||
url_end = strchr(url_begin, '\0');
|
url_end = strchr((const char *)url_begin, '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In any case, trim all spaces from the end of the URL. */
|
/* In any case, trim all spaces from the end of the URL. */
|
||||||
|
@ -96,12 +96,12 @@ html_form(struct html_context *html_context, unsigned char *a,
|
|||||||
form->action = get_uri_string(html_context->base_href, components);
|
form->action = get_uri_string(html_context->base_href, components);
|
||||||
|
|
||||||
/* No action URI should contain post data */
|
/* No action URI should contain post data */
|
||||||
assert(!form->action || !strchr(form->action, POST_CHAR));
|
assert(!form->action || !strchr((const char *)form->action, POST_CHAR));
|
||||||
|
|
||||||
/* GET method URIs should not have '?'. */
|
/* GET method URIs should not have '?'. */
|
||||||
assert(!form->action
|
assert(!form->action
|
||||||
|| form->method != FORM_METHOD_GET
|
|| form->method != FORM_METHOD_GET
|
||||||
|| !strchr(form->action, '?'));
|
|| !strchr((const char *)form->action, '?'));
|
||||||
}
|
}
|
||||||
|
|
||||||
al = get_target(html_context->options, a);
|
al = get_target(html_context->options, a);
|
||||||
|
@ -332,7 +332,7 @@ parse_dom_config(unsigned char *flaglist, unsigned char separator)
|
|||||||
enum dom_config_flag flags = 0;
|
enum dom_config_flag flags = 0;
|
||||||
|
|
||||||
while (flaglist) {
|
while (flaglist) {
|
||||||
unsigned char *end = separator ? strchr(flaglist, separator) : NULL;
|
unsigned char *end = separator ? strchr((const char *)flaglist, separator) : NULL;
|
||||||
int length = end ? end - flaglist : strlen(flaglist);
|
int length = end ? end - flaglist : strlen(flaglist);
|
||||||
struct dom_string name = INIT_DOM_STRING(flaglist, length);
|
struct dom_string name = INIT_DOM_STRING(flaglist, length);
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ load_formhist_from_file(void)
|
|||||||
|
|
||||||
if (tmp[0] == '\n' && !tmp[1]) continue;
|
if (tmp[0] == '\n' && !tmp[1]) continue;
|
||||||
|
|
||||||
p = strchr(tmp, '\t');
|
p = strchr((const char *)tmp, '\t');
|
||||||
if (p) {
|
if (p) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
++p;
|
++p;
|
||||||
@ -149,13 +149,13 @@ load_formhist_from_file(void)
|
|||||||
|
|
||||||
/* Type */
|
/* Type */
|
||||||
type = tmp;
|
type = tmp;
|
||||||
p = strchr(type, '\t');
|
p = strchr((const char *)type, '\t');
|
||||||
if (!p) goto fail;
|
if (!p) goto fail;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
/* Name */
|
/* Name */
|
||||||
name = ++p;
|
name = ++p;
|
||||||
p = strchr(name, '\t');
|
p = strchr((const char *)name, '\t');
|
||||||
if (!p) {
|
if (!p) {
|
||||||
/* Compatibility with previous file formats.
|
/* Compatibility with previous file formats.
|
||||||
* REMOVE AT SOME TIME --Zas */
|
* REMOVE AT SOME TIME --Zas */
|
||||||
@ -176,7 +176,7 @@ load_formhist_from_file(void)
|
|||||||
/* Value */
|
/* Value */
|
||||||
value = ++p;
|
value = ++p;
|
||||||
cont:
|
cont:
|
||||||
p = strchr(value, '\n');
|
p = strchr((const char *)value, '\n');
|
||||||
if (!p) goto fail;
|
if (!p) goto fail;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
|
@ -353,15 +353,15 @@ read_global_history(void)
|
|||||||
while (fgets(in_buffer, sizeof(in_buffer), f)) {
|
while (fgets(in_buffer, sizeof(in_buffer), f)) {
|
||||||
unsigned char *url, *last_visit, *eol;
|
unsigned char *url, *last_visit, *eol;
|
||||||
|
|
||||||
url = strchr(title, '\t');
|
url = strchr((const char *)title, '\t');
|
||||||
if (!url) continue;
|
if (!url) continue;
|
||||||
*url++ = '\0'; /* Now url points to the character after \t. */
|
*url++ = '\0'; /* Now url points to the character after \t. */
|
||||||
|
|
||||||
last_visit = strchr(url, '\t');
|
last_visit = strchr((const char *)url, '\t');
|
||||||
if (!last_visit) continue;
|
if (!last_visit) continue;
|
||||||
*last_visit++ = '\0';
|
*last_visit++ = '\0';
|
||||||
|
|
||||||
eol = strchr(last_visit, '\n');
|
eol = strchr((const char *)last_visit, '\n');
|
||||||
if (!eol) continue;
|
if (!eol) continue;
|
||||||
*eol = '\0'; /* Drop ending '\n'. */
|
*eol = '\0'; /* Drop ending '\n'. */
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ int
|
|||||||
strlen_utf8(unsigned char **str)
|
strlen_utf8(unsigned char **str)
|
||||||
{
|
{
|
||||||
unsigned char *s = *str;
|
unsigned char *s = *str;
|
||||||
unsigned char *end = strchr(s, '\0');
|
unsigned char *end = strchr((const char *)s, '\0');
|
||||||
int x;
|
int x;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ utf8_char2cells(unsigned char *utf8_char, unsigned char *end)
|
|||||||
unicode_val_T u;
|
unicode_val_T u;
|
||||||
|
|
||||||
if (end == NULL)
|
if (end == NULL)
|
||||||
end = strchr(utf8_char, '\0');
|
end = strchr((const char *)utf8_char, '\0');
|
||||||
|
|
||||||
if(!utf8_char || !end)
|
if(!utf8_char || !end)
|
||||||
return -1;
|
return -1;
|
||||||
@ -352,7 +352,7 @@ utf8_ptr2cells(unsigned char *string, unsigned char *end)
|
|||||||
int charlen, cell, cells = 0;
|
int charlen, cell, cells = 0;
|
||||||
|
|
||||||
if (end == NULL)
|
if (end == NULL)
|
||||||
end = strchr(string, '\0');
|
end = strchr((const char *)string, '\0');
|
||||||
|
|
||||||
if(!string || !end)
|
if(!string || !end)
|
||||||
return -1;
|
return -1;
|
||||||
@ -380,7 +380,7 @@ utf8_ptr2chars(unsigned char *string, unsigned char *end)
|
|||||||
int charlen, chars = 0;
|
int charlen, chars = 0;
|
||||||
|
|
||||||
if (end == NULL)
|
if (end == NULL)
|
||||||
end = strchr(string, '\0');
|
end = strchr((const char *)string, '\0');
|
||||||
|
|
||||||
if(!string || !end)
|
if(!string || !end)
|
||||||
return -1;
|
return -1;
|
||||||
@ -409,7 +409,7 @@ utf8_cells2bytes(unsigned char *string, int max_cells, unsigned char *end)
|
|||||||
assert(max_cells>=0);
|
assert(max_cells>=0);
|
||||||
|
|
||||||
if (end == NULL)
|
if (end == NULL)
|
||||||
end = strchr(string, '\0');
|
end = strchr((const char *)string, '\0');
|
||||||
|
|
||||||
if(!string || !end)
|
if(!string || !end)
|
||||||
return -1;
|
return -1;
|
||||||
@ -455,7 +455,7 @@ utf8_step_forward(unsigned char *string, unsigned char *end,
|
|||||||
assert(max >= 0);
|
assert(max >= 0);
|
||||||
if_assert_failed goto invalid_arg;
|
if_assert_failed goto invalid_arg;
|
||||||
if (end == NULL)
|
if (end == NULL)
|
||||||
end = strchr(string, '\0');
|
end = strchr((const char *)string, '\0');
|
||||||
|
|
||||||
switch (way) {
|
switch (way) {
|
||||||
case UTF8_STEP_CHARACTERS:
|
case UTF8_STEP_CHARACTERS:
|
||||||
|
@ -110,11 +110,11 @@ extern int errno;
|
|||||||
/* Win32, OS/2, DOS */
|
/* Win32, OS/2, DOS */
|
||||||
#define HAS_DEVICE(P) (isasciialpha((P)[0]) && (P)[1] == ':')
|
#define HAS_DEVICE(P) (isasciialpha((P)[0]) && (P)[1] == ':')
|
||||||
#define IS_ABSOLUTE_PATH(P) (dir_sep((P)[0]) || HAS_DEVICE (P))
|
#define IS_ABSOLUTE_PATH(P) (dir_sep((P)[0]) || HAS_DEVICE (P))
|
||||||
#define IS_PATH_WITH_DIR(P) (strchr (P, '/') || strchr (P, '\\') || HAS_DEVICE (P))
|
#define IS_PATH_WITH_DIR(P) (strchr ((const char *)(P), '/') || strchr ((const char *)(P), '\\') || HAS_DEVICE (P))
|
||||||
#else
|
#else
|
||||||
/* Unix */
|
/* Unix */
|
||||||
#define IS_ABSOLUTE_PATH(P) dir_sep((P)[0])
|
#define IS_ABSOLUTE_PATH(P) dir_sep((P)[0])
|
||||||
#define IS_PATH_WITH_DIR(P) strchr (P, '/')
|
#define IS_PATH_WITH_DIR(P) strchr ((const char *)(P), '/')
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XPG3 defines the result of `setlocale (category, NULL)' as:
|
/* XPG3 defines the result of `setlocale (category, NULL)' as:
|
||||||
@ -401,7 +401,7 @@ dcigettext__(const unsigned char *domainname, const unsigned char *msgid1, const
|
|||||||
: n == 1 ? (unsigned char *) msgid1 : (unsigned char *) msgid2);
|
: n == 1 ? (unsigned char *) msgid1 : (unsigned char *) msgid2);
|
||||||
}
|
}
|
||||||
|
|
||||||
stpcpy(stpcpy(strchr(dirname, '\0'), "/"), binding->dirname);
|
stpcpy(stpcpy(strchr((const char *)dirname, '\0'), "/"), binding->dirname);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now determine the symbolic name of CATEGORY and its value. */
|
/* Now determine the symbolic name of CATEGORY and its value. */
|
||||||
@ -781,7 +781,7 @@ plural_lookup(struct loaded_l10nfile *domain, unsigned long int n,
|
|||||||
/* Skip INDEX strings at TRANSLATION. */
|
/* Skip INDEX strings at TRANSLATION. */
|
||||||
p = translation;
|
p = translation;
|
||||||
while (indexx-- > 0) {
|
while (indexx-- > 0) {
|
||||||
p = strchr(p, '\0');
|
p = strchr((const char *)p, '\0');
|
||||||
|
|
||||||
/* And skip over the NUL byte. */
|
/* And skip over the NUL byte. */
|
||||||
p++;
|
p++;
|
||||||
|
@ -77,7 +77,7 @@ _nl_explode_name(unsigned char *name, const unsigned char **language, const unsi
|
|||||||
if (*language == cp)
|
if (*language == cp)
|
||||||
/* This does not make sense: language has to be specified. Use
|
/* This does not make sense: language has to be specified. Use
|
||||||
this entry as it is without exploding. Perhaps it is an alias. */
|
this entry as it is without exploding. Perhaps it is an alias. */
|
||||||
cp = strchr(*language, '\0');
|
cp = strchr((const char *)*language, '\0');
|
||||||
else if (cp[0] == '_') {
|
else if (cp[0] == '_') {
|
||||||
/* Next is the territory. */
|
/* Next is the territory. */
|
||||||
cp[0] = '\0';
|
cp[0] = '\0';
|
||||||
|
@ -119,7 +119,7 @@ argz_next__(unsigned char *argz, size_t argz_len, const unsigned char *entry)
|
|||||||
{
|
{
|
||||||
if (entry) {
|
if (entry) {
|
||||||
if (entry < argz + argz_len)
|
if (entry < argz + argz_len)
|
||||||
entry = strchr(entry, '\0') + 1;
|
entry = strchr((const char *)entry, '\0') + 1;
|
||||||
|
|
||||||
return entry >= argz + argz_len ? NULL : (unsigned char *) entry;
|
return entry >= argz + argz_len ? NULL : (unsigned char *) entry;
|
||||||
} else if (argz_len > 0)
|
} else if (argz_len > 0)
|
||||||
|
@ -81,15 +81,15 @@ iso639_to_language(unsigned char *iso639)
|
|||||||
|
|
||||||
/* The environment variable transformation. */
|
/* The environment variable transformation. */
|
||||||
|
|
||||||
p = strchr(l, '.');
|
p = strchr((const char *)l, '.');
|
||||||
if (p)
|
if (p)
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
p = strchr(l, '_');
|
p = strchr((const char *)l, '_');
|
||||||
if (p)
|
if (p)
|
||||||
*p = '-';
|
*p = '-';
|
||||||
else
|
else
|
||||||
p = strchr(l, '-');
|
p = strchr((const char *)l, '-');
|
||||||
|
|
||||||
/* Exact match. */
|
/* Exact match. */
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ set_language(int language)
|
|||||||
}
|
}
|
||||||
if (LANGUAGE) {
|
if (LANGUAGE) {
|
||||||
strcpy(LANGUAGE, language_to_iso639(language));
|
strcpy(LANGUAGE, language_to_iso639(language));
|
||||||
p = strchr(LANGUAGE, '-');
|
p = strchr((const char *)LANGUAGE, '-');
|
||||||
if (p) {
|
if (p) {
|
||||||
*p = '_';
|
*p = '_';
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ read_alias_file(const unsigned char *fname, int fname_len)
|
|||||||
|
|
||||||
/* Possibly not the whole line fits into the buffer. Ignore
|
/* Possibly not the whole line fits into the buffer. Ignore
|
||||||
the rest of the line. */
|
the rest of the line. */
|
||||||
if (strchr(buf, '\n') == NULL) {
|
if (strchr((const char *)buf, '\n') == NULL) {
|
||||||
unsigned char altbuf[BUFSIZ];
|
unsigned char altbuf[BUFSIZ];
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -162,7 +162,7 @@ read_alias_file(const unsigned char *fname, int fname_len)
|
|||||||
/* Make sure the inner loop will be left. The outer loop
|
/* Make sure the inner loop will be left. The outer loop
|
||||||
will exit at the `feof' test. */
|
will exit at the `feof' test. */
|
||||||
break;
|
break;
|
||||||
while (strchr(altbuf, '\n') == NULL);
|
while (strchr((const char *)altbuf, '\n') == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
cp = buf;
|
cp = buf;
|
||||||
|
@ -70,7 +70,7 @@ wrap_string(struct string *string, int start_at, int maxlen)
|
|||||||
if (maxlen <= 0) return;
|
if (maxlen <= 0) return;
|
||||||
|
|
||||||
pos = start_pos = &string->source[start_at];
|
pos = start_pos = &string->source[start_at];
|
||||||
while ((pos = strchr(pos, ' '))) {
|
while ((pos = strchr((const char *)pos, ' '))) {
|
||||||
int len = pos - start_pos;
|
int len = pos - start_pos;
|
||||||
|
|
||||||
if (len < maxlen) {
|
if (len < maxlen) {
|
||||||
|
@ -160,7 +160,7 @@ get_mime_type_option(unsigned char *type)
|
|||||||
|
|
||||||
if (add_optname_to_string(&name, type, strlen(type))) {
|
if (add_optname_to_string(&name, type, strlen(type))) {
|
||||||
/* Search for end of the base type. */
|
/* Search for end of the base type. */
|
||||||
unsigned char *pos = strchr(name.source, '/');
|
unsigned char *pos = strchr((const char *)name.source, '/');
|
||||||
|
|
||||||
if (pos) {
|
if (pos) {
|
||||||
*pos = '.';
|
*pos = '.';
|
||||||
|
@ -232,7 +232,7 @@ get_mailcap_field(unsigned char **next)
|
|||||||
if (*fieldend == ';')
|
if (*fieldend == ';')
|
||||||
fieldend++;
|
fieldend++;
|
||||||
|
|
||||||
fieldend = strchr(fieldend, ';');
|
fieldend = strchr((const char *)fieldend, ';');
|
||||||
} while (fieldend && *(fieldend-1) == '\\');
|
} while (fieldend && *(fieldend-1) == '\\');
|
||||||
|
|
||||||
if (fieldend) {
|
if (fieldend) {
|
||||||
@ -359,7 +359,7 @@ parse_mailcap_file(unsigned char *filename, unsigned int priority)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
basetypeend = strchr(type, '/');
|
basetypeend = strchr((const char *)type, '/');
|
||||||
typelen = strlen(type);
|
typelen = strlen(type);
|
||||||
|
|
||||||
if (!basetypeend) {
|
if (!basetypeend) {
|
||||||
@ -609,7 +609,7 @@ get_mailcap_entry(unsigned char *type)
|
|||||||
/* The type lookup has either failed or we need to check
|
/* The type lookup has either failed or we need to check
|
||||||
* the priorities so get the wild card handler */
|
* the priorities so get the wild card handler */
|
||||||
struct mailcap_entry *wildcard = NULL;
|
struct mailcap_entry *wildcard = NULL;
|
||||||
unsigned char *wildpos = strchr(type, '/');
|
unsigned char *wildpos = strchr((const char *)type, '/');
|
||||||
|
|
||||||
if (wildpos) {
|
if (wildpos) {
|
||||||
int wildlen = wildpos - type + 1; /* include '/' */
|
int wildlen = wildpos - type + 1; /* include '/' */
|
||||||
|
@ -141,7 +141,7 @@ parse_mimetypes_file(unsigned char *filename)
|
|||||||
unsigned char *token;
|
unsigned char *token;
|
||||||
|
|
||||||
/* Weed out any comments */
|
/* Weed out any comments */
|
||||||
token = strchr(line, '#');
|
token = strchr((const char *)line, '#');
|
||||||
if (token)
|
if (token)
|
||||||
*token = '\0';
|
*token = '\0';
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ parse_mimetypes_file(unsigned char *filename)
|
|||||||
*token++ = '\0';
|
*token++ = '\0';
|
||||||
|
|
||||||
/* Check if malformed content type */
|
/* Check if malformed content type */
|
||||||
if (!strchr(ctype, '/')) continue;
|
if (!strchr((const char *)ctype, '/')) continue;
|
||||||
|
|
||||||
parse_mimetypes_extensions(token, ctype);
|
parse_mimetypes_extensions(token, ctype);
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ get_content_type_mimetypes(unsigned char *extension)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Try to trim the extension from the left. */
|
/* Try to trim the extension from the left. */
|
||||||
trimmed = strchr(extension, '.');
|
trimmed = strchr((const char *)extension, '.');
|
||||||
if (!trimmed)
|
if (!trimmed)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ get_cache_header_content_type(struct cache_entry *cached)
|
|||||||
|
|
||||||
ctype = parse_header(cached->head, "Content-Type", NULL);
|
ctype = parse_header(cached->head, "Content-Type", NULL);
|
||||||
if (ctype) {
|
if (ctype) {
|
||||||
unsigned char *end = strchr(ctype, ';');
|
unsigned char *end = strchr((const char *)ctype, ';');
|
||||||
int ctypelen;
|
int ctypelen;
|
||||||
|
|
||||||
if (end) *end = '\0';
|
if (end) *end = '\0';
|
||||||
|
@ -296,7 +296,7 @@ make_bittorrent_peer_connection(struct bittorrent_connection *bittorrent,
|
|||||||
if (!init_string(&uri_string)) goto out;
|
if (!init_string(&uri_string)) goto out;
|
||||||
if (!add_format_to_string(&uri_string,
|
if (!add_format_to_string(&uri_string,
|
||||||
#ifdef CONFIG_IPV6
|
#ifdef CONFIG_IPV6
|
||||||
strchr(peer_info->ip, ':') ?
|
strchr((const char *)peer_info->ip, ':') ?
|
||||||
"bittorrent-peer://[%s]:%u/" :
|
"bittorrent-peer://[%s]:%u/" :
|
||||||
#endif
|
#endif
|
||||||
"bittorrent-peer://%s:%u/",
|
"bittorrent-peer://%s:%u/",
|
||||||
|
@ -122,7 +122,7 @@ init_directory_listing(struct string *page, struct uri *uri)
|
|||||||
const unsigned char *pslash = slash;
|
const unsigned char *pslash = slash;
|
||||||
const unsigned char sep = local ? CHAR_DIR_SEP : '/';
|
const unsigned char sep = local ? CHAR_DIR_SEP : '/';
|
||||||
|
|
||||||
while ((slash = strchr(slash, sep)) != NULL) {
|
while ((slash = strchr((const char *)slash, sep)) != NULL) {
|
||||||
done_string(&decoded);
|
done_string(&decoded);
|
||||||
if (!init_string(&decoded)
|
if (!init_string(&decoded)
|
||||||
|| !add_bytes_to_string(&decoded, pslash, slash - pslash))
|
|| !add_bytes_to_string(&decoded, pslash, slash - pslash))
|
||||||
|
@ -116,7 +116,7 @@ send_post_data(struct connection *conn)
|
|||||||
unsigned char *postend;
|
unsigned char *postend;
|
||||||
struct connection_state error;
|
struct connection_state error;
|
||||||
|
|
||||||
postend = strchr(post, '\n');
|
postend = strchr((const char *)post, '\n');
|
||||||
if (postend) post = postend + 1;
|
if (postend) post = postend + 1;
|
||||||
|
|
||||||
if (!open_http_post(&http->post, post, &error))
|
if (!open_http_post(&http->post, post, &error))
|
||||||
@ -148,7 +148,7 @@ set_vars(struct connection *conn, unsigned char *script)
|
|||||||
if (res) return -1;
|
if (res) return -1;
|
||||||
|
|
||||||
if (post) {
|
if (post) {
|
||||||
unsigned char *postend = strchr(post, '\n');
|
unsigned char *postend = strchr((const char *)post, '\n');
|
||||||
unsigned char buf[16];
|
unsigned char buf[16];
|
||||||
|
|
||||||
if (postend) {
|
if (postend) {
|
||||||
|
@ -44,7 +44,7 @@ main(int argc, char *argv[])
|
|||||||
while (*response) {
|
while (*response) {
|
||||||
unsigned char *start = response;
|
unsigned char *start = response;
|
||||||
|
|
||||||
response = strchr(response, '\n');
|
response = strchr((const char *)response, '\n');
|
||||||
if (!response) {
|
if (!response) {
|
||||||
response = start + strlen(start);
|
response = start + strlen(start);
|
||||||
} else {
|
} else {
|
||||||
|
@ -831,7 +831,7 @@ static void
|
|||||||
send_it_line_by_line(struct connection *conn, struct string *cmd)
|
send_it_line_by_line(struct connection *conn, struct string *cmd)
|
||||||
{
|
{
|
||||||
struct ftp_connection_info *ftp = conn->info;
|
struct ftp_connection_info *ftp = conn->info;
|
||||||
unsigned char *nl = strchr(ftp->cmd_buffer, '\n');
|
unsigned char *nl = strchr((const char *)ftp->cmd_buffer, '\n');
|
||||||
|
|
||||||
if (!nl) {
|
if (!nl) {
|
||||||
add_to_string(cmd, ftp->cmd_buffer);
|
add_to_string(cmd, ftp->cmd_buffer);
|
||||||
|
@ -414,7 +414,7 @@ add_gopher_menu_line(struct string *buffer, unsigned char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (*name) {
|
if (*name) {
|
||||||
selector = strchr(name, ASCII_TAB);
|
selector = strchr((const char *)name, ASCII_TAB);
|
||||||
if (selector) {
|
if (selector) {
|
||||||
/* Terminate name */
|
/* Terminate name */
|
||||||
*selector++ = '\0';
|
*selector++ = '\0';
|
||||||
@ -428,13 +428,13 @@ add_gopher_menu_line(struct string *buffer, unsigned char *line)
|
|||||||
entity = *selector;
|
entity = *selector;
|
||||||
}
|
}
|
||||||
|
|
||||||
host = selector ? strchr(selector, ASCII_TAB) : NULL;
|
host = selector ? strchr((const char *)selector, ASCII_TAB) : NULL;
|
||||||
if (host) {
|
if (host) {
|
||||||
/* Terminate selector */
|
/* Terminate selector */
|
||||||
*host++ = '\0';
|
*host++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
port = host ? strchr(host, ASCII_TAB) : NULL;
|
port = host ? strchr((const char *)host, ASCII_TAB) : NULL;
|
||||||
if (port) {
|
if (port) {
|
||||||
unsigned char *end;
|
unsigned char *end;
|
||||||
int portno;
|
int portno;
|
||||||
|
@ -247,7 +247,7 @@ parse_header_param(unsigned char *str, unsigned char *name, unsigned char **ret)
|
|||||||
|
|
||||||
namelen = strlen(name);
|
namelen = strlen(name);
|
||||||
do {
|
do {
|
||||||
p = strchr(p, ';');
|
p = strchr((const char *)p, ';');
|
||||||
if (!p) return HEADER_PARAM_NOT_FOUND;
|
if (!p) return HEADER_PARAM_NOT_FOUND;
|
||||||
|
|
||||||
while (*p && (*p == ';' || *p <= ' ')) p++;
|
while (*p && (*p == ';' || *p <= ' ')) p++;
|
||||||
|
@ -998,7 +998,7 @@ http_send_header(struct socket *socket)
|
|||||||
/* We search for first '\n' in uri->post to get content type
|
/* We search for first '\n' in uri->post to get content type
|
||||||
* as set by get_form_uri(). This '\n' is dropped if any
|
* as set by get_form_uri(). This '\n' is dropped if any
|
||||||
* and replaced by correct '\r\n' termination here. */
|
* and replaced by correct '\r\n' termination here. */
|
||||||
unsigned char *postend = strchr(uri->post, '\n');
|
unsigned char *postend = strchr((const char *)uri->post, '\n');
|
||||||
struct connection_state error;
|
struct connection_state error;
|
||||||
|
|
||||||
if (postend) {
|
if (postend) {
|
||||||
|
@ -104,9 +104,9 @@ open_http_post(struct http_post *http_post, const unsigned char *post_data,
|
|||||||
struct http_post_file *new_files;
|
struct http_post_file *new_files;
|
||||||
unsigned char *filename;
|
unsigned char *filename;
|
||||||
|
|
||||||
begin = strchr(end, FILE_CHAR);
|
begin = strchr((const char *)end, FILE_CHAR);
|
||||||
if (!begin) break;
|
if (!begin) break;
|
||||||
end = strchr(begin + 1, FILE_CHAR);
|
end = strchr((const char *)(begin + 1), FILE_CHAR);
|
||||||
if (!end) break;
|
if (!end) break;
|
||||||
filename = memacpy(begin + 1, end - begin - 1); /* adds '\0' */
|
filename = memacpy(begin + 1, end - begin - 1); /* adds '\0' */
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
@ -160,14 +160,14 @@ read_http_post_inline(struct http_post *http_post,
|
|||||||
struct connection_state *error)
|
struct connection_state *error)
|
||||||
{
|
{
|
||||||
const unsigned char *post = http_post->post_data;
|
const unsigned char *post = http_post->post_data;
|
||||||
const unsigned char *end = strchr(post, FILE_CHAR);
|
const unsigned char *end = strchr((const char *)post, FILE_CHAR);
|
||||||
int total = 0;
|
int total = 0;
|
||||||
|
|
||||||
assert(http_post->post_fd < 0);
|
assert(http_post->post_fd < 0);
|
||||||
if_assert_failed { *error = connection_state(S_INTERNAL); return -1; }
|
if_assert_failed { *error = connection_state(S_INTERNAL); return -1; }
|
||||||
|
|
||||||
if (!end)
|
if (!end)
|
||||||
end = strchr(post, '\0');
|
end = strchr((const char *)post, '\0');
|
||||||
|
|
||||||
while (post < end && total < max) {
|
while (post < end && total < max) {
|
||||||
int h1, h2;
|
int h1, h2;
|
||||||
@ -189,7 +189,7 @@ read_http_post_inline(struct http_post *http_post,
|
|||||||
}
|
}
|
||||||
|
|
||||||
http_post->file_read = 0;
|
http_post->file_read = 0;
|
||||||
end = strchr(post + 1, FILE_CHAR);
|
end = strchr((const char *)(post + 1), FILE_CHAR);
|
||||||
assert(end);
|
assert(end);
|
||||||
http_post->post_fd = open(http_post->files[http_post->file_index].name,
|
http_post->post_fd = open(http_post->files[http_post->file_index].name,
|
||||||
O_RDONLY);
|
O_RDONLY);
|
||||||
|
@ -288,7 +288,7 @@ add_header_to_string(struct string *str, unsigned char *header)
|
|||||||
* ep : "=?ISO-8859-1?Q?Foo=FCbar?= baz"
|
* ep : "=?ISO-8859-1?Q?Foo=FCbar?= baz"
|
||||||
*/
|
*/
|
||||||
end += 2;
|
end += 2;
|
||||||
cp = strchr(end, '?');
|
cp = strchr((const char *)end, '?');
|
||||||
if (!cp)
|
if (!cp)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -423,7 +423,7 @@ add_nntp_html_line(struct string *html, struct connection *conn,
|
|||||||
{
|
{
|
||||||
unsigned char *field = line;
|
unsigned char *field = line;
|
||||||
|
|
||||||
line = strchr(line, '\t');
|
line = strchr((const char *)line, '\t');
|
||||||
if (!line)
|
if (!line)
|
||||||
field = "";
|
field = "";
|
||||||
else
|
else
|
||||||
@ -432,7 +432,7 @@ add_nntp_html_line(struct string *html, struct connection *conn,
|
|||||||
field, struri(conn->uri), field);
|
field, struri(conn->uri), field);
|
||||||
|
|
||||||
field = line;
|
field = line;
|
||||||
line = strchr(line, '\t');
|
line = strchr((const char *)line, '\t');
|
||||||
if (line)
|
if (line)
|
||||||
*line++ = 0;
|
*line++ = 0;
|
||||||
|
|
||||||
@ -441,7 +441,7 @@ add_nntp_html_line(struct string *html, struct connection *conn,
|
|||||||
|
|
||||||
if (line) {
|
if (line) {
|
||||||
field = line;
|
field = line;
|
||||||
line = strchr(line, '\t');
|
line = strchr((const char *)line, '\t');
|
||||||
if (line)
|
if (line)
|
||||||
*line++ = 0;
|
*line++ = 0;
|
||||||
|
|
||||||
|
@ -27,12 +27,12 @@
|
|||||||
static int
|
static int
|
||||||
proxy_probe_no_proxy(unsigned char *url, unsigned char *no_proxy)
|
proxy_probe_no_proxy(unsigned char *url, unsigned char *no_proxy)
|
||||||
{
|
{
|
||||||
unsigned char *slash = strchr(url, '/');
|
unsigned char *slash = strchr((const char *)url, '/');
|
||||||
|
|
||||||
if (slash) *slash = '\0';
|
if (slash) *slash = '\0';
|
||||||
|
|
||||||
while (no_proxy && *no_proxy) {
|
while (no_proxy && *no_proxy) {
|
||||||
unsigned char *jumper = strchr(no_proxy, ',');
|
unsigned char *jumper = strchr((const char *)no_proxy, ',');
|
||||||
|
|
||||||
skip_space(no_proxy);
|
skip_space(no_proxy);
|
||||||
if (jumper) *jumper = '\0';
|
if (jumper) *jumper = '\0';
|
||||||
@ -168,7 +168,7 @@ get_proxy_worker(struct uri *uri, unsigned char *proxy,
|
|||||||
|
|
||||||
if (protocol_proxy && *protocol_proxy) {
|
if (protocol_proxy && *protocol_proxy) {
|
||||||
unsigned char *no_proxy;
|
unsigned char *no_proxy;
|
||||||
unsigned char *slash = strchr(protocol_proxy, '/');
|
unsigned char *slash = strchr((const char *)protocol_proxy, '/');
|
||||||
|
|
||||||
if (slash) *slash = 0;
|
if (slash) *slash = 0;
|
||||||
|
|
||||||
|
@ -325,9 +325,9 @@ goto_url_hook(va_list ap, void *data)
|
|||||||
uu = get_uri_rewrite_prefix(URI_REWRITE_DUMB, *url);
|
uu = get_uri_rewrite_prefix(URI_REWRITE_DUMB, *url);
|
||||||
|
|
||||||
if (!uu
|
if (!uu
|
||||||
&& !strchr(*url, ':')
|
&& !strchr((const char *)*url, ':')
|
||||||
&& !strchr(*url, '.')
|
&& !strchr((const char *)*url, '.')
|
||||||
&& !strchr(*url, '/')) {
|
&& !strchr((const char *)*url, '/')) {
|
||||||
uu = get_opt_str("protocol.rewrite.default_template", NULL);
|
uu = get_opt_str("protocol.rewrite.default_template", NULL);
|
||||||
if (uu && *uu) {
|
if (uu && *uu) {
|
||||||
arg = *url;
|
arg = *url;
|
||||||
|
@ -289,9 +289,9 @@ parse_uri(struct uri *uri, unsigned char *uristring)
|
|||||||
|
|
||||||
#ifdef CONFIG_IPV6
|
#ifdef CONFIG_IPV6
|
||||||
/* Get brackets enclosing IPv6 address */
|
/* Get brackets enclosing IPv6 address */
|
||||||
lbracket = strchr(prefix_end, '[');
|
lbracket = strchr((const char *)prefix_end, '[');
|
||||||
if (lbracket) {
|
if (lbracket) {
|
||||||
rbracket = strchr(lbracket, ']');
|
rbracket = strchr((const char *)lbracket, ']');
|
||||||
/* [address] is handled only inside of hostname part (surprisingly). */
|
/* [address] is handled only inside of hostname part (surprisingly). */
|
||||||
if (rbracket && rbracket < prefix_end + strcspn(prefix_end, "/"))
|
if (rbracket && rbracket < prefix_end + strcspn(prefix_end, "/"))
|
||||||
uri->ipv6 = 1;
|
uri->ipv6 = 1;
|
||||||
@ -313,7 +313,7 @@ parse_uri(struct uri *uri, unsigned char *uristring)
|
|||||||
while (strcspn(host_end + 1, "@") < strcspn(host_end + 1, "/?"))
|
while (strcspn(host_end + 1, "@") < strcspn(host_end + 1, "/?"))
|
||||||
host_end = host_end + 1 + strcspn(host_end + 1, "@");
|
host_end = host_end + 1 + strcspn(host_end + 1, "@");
|
||||||
|
|
||||||
user_end = strchr(prefix_end, ':');
|
user_end = strchr((const char *)prefix_end, ':');
|
||||||
|
|
||||||
if (!user_end || user_end > host_end) {
|
if (!user_end || user_end > host_end) {
|
||||||
uri->user = prefix_end;
|
uri->user = prefix_end;
|
||||||
@ -1022,7 +1022,7 @@ find_uri_protocol(unsigned char *newurl)
|
|||||||
|
|
||||||
ch = newurl + strcspn(newurl, ".:/@");
|
ch = newurl + strcspn(newurl, ".:/@");
|
||||||
if (*ch == '@'
|
if (*ch == '@'
|
||||||
|| (*ch == ':' && *newurl != '[' && strchr(newurl, '@'))
|
|| (*ch == ':' && *newurl != '[' && strchr((const char *)newurl, '@'))
|
||||||
|| !c_strncasecmp(newurl, "ftp.", 4)) {
|
|| !c_strncasecmp(newurl, "ftp.", 4)) {
|
||||||
/* Contains user/password/ftp-hostname */
|
/* Contains user/password/ftp-hostname */
|
||||||
return PROTOCOL_FTP;
|
return PROTOCOL_FTP;
|
||||||
@ -1033,8 +1033,8 @@ find_uri_protocol(unsigned char *newurl)
|
|||||||
unsigned char *bracket2, *colon2;
|
unsigned char *bracket2, *colon2;
|
||||||
|
|
||||||
ch++;
|
ch++;
|
||||||
bracket2 = strchr(ch, ']');
|
bracket2 = strchr((const char *)ch, ']');
|
||||||
colon2 = strchr(ch, ':');
|
colon2 = strchr((const char *)ch, ':');
|
||||||
if (bracket2 && colon2 && bracket2 > colon2)
|
if (bracket2 && colon2 && bracket2 > colon2)
|
||||||
return PROTOCOL_HTTP;
|
return PROTOCOL_HTTP;
|
||||||
#endif
|
#endif
|
||||||
|
@ -234,7 +234,7 @@ save_form_data_to_file(struct uri *uri)
|
|||||||
if (!uri->post) return filename;
|
if (!uri->post) return filename;
|
||||||
|
|
||||||
/* Jump the content type */
|
/* Jump the content type */
|
||||||
formdata = strchr(uri->post, '\n');
|
formdata = strchr((const char *)uri->post, '\n');
|
||||||
formdata = formdata ? formdata + 1 : uri->post;
|
formdata = formdata ? formdata + 1 : uri->post;
|
||||||
len = strlen(formdata);
|
len = strlen(formdata);
|
||||||
if (len == 0) return filename;
|
if (len == 0) return filename;
|
||||||
|
@ -90,7 +90,7 @@ erb_report_error(struct session *ses, int error)
|
|||||||
snprintf(buff, MAX_STR_LEN, "%s: %s",
|
snprintf(buff, MAX_STR_LEN, "%s: %s",
|
||||||
RSTRING(epath)->ptr, RSTRING(einfo)->ptr);
|
RSTRING(epath)->ptr, RSTRING(einfo)->ptr);
|
||||||
|
|
||||||
p = strchr(buff, '\n');
|
p = strchr((const char *)buff, '\n');
|
||||||
if (p) *p = '\0';
|
if (p) *p = '\0';
|
||||||
msg = buff;
|
msg = buff;
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ erb_module_message(VALUE self, VALUE str)
|
|||||||
message = memacpy(RSTRING(str)->ptr, RSTRING(str)->len);
|
message = memacpy(RSTRING(str)->ptr, RSTRING(str)->len);
|
||||||
if (!message) return Qnil;
|
if (!message) return Qnil;
|
||||||
|
|
||||||
line_end = strchr(message, '\n');
|
line_end = strchr((const char *)message, '\n');
|
||||||
if (line_end) *line_end = '\0';
|
if (line_end) *line_end = '\0';
|
||||||
|
|
||||||
term = get_default_terminal();
|
term = get_default_terminal();
|
||||||
|
@ -487,7 +487,7 @@ resize_terminal_from_str(unsigned char *text)
|
|||||||
if_assert_failed return;
|
if_assert_failed return;
|
||||||
|
|
||||||
for (i = 0; i < NUMBERS; i++) {
|
for (i = 0; i < NUMBERS; i++) {
|
||||||
unsigned char *p = strchr(text, ',');
|
unsigned char *p = strchr((const char *)text, ',');
|
||||||
|
|
||||||
if (p) {
|
if (p) {
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
|
@ -205,7 +205,7 @@ file_read_line(unsigned char *line, size_t *size, FILE *file, int *lineno)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (fgets(line + offset, *size - offset, file)) {
|
while (fgets(line + offset, *size - offset, file)) {
|
||||||
unsigned char *linepos = strchr(line + offset, '\n');
|
unsigned char *linepos = strchr((const char *)(line + offset), '\n');
|
||||||
|
|
||||||
if (!linepos) {
|
if (!linepos) {
|
||||||
/* Test if the line buffer should be increase because
|
/* Test if the line buffer should be increase because
|
||||||
|
@ -603,7 +603,7 @@ drew_char:
|
|||||||
#ifdef CONFIG_UTF8
|
#ifdef CONFIG_UTF8
|
||||||
utf8_select:
|
utf8_select:
|
||||||
text = s;
|
text = s;
|
||||||
end = strchr(s, '\0');
|
end = strchr((const char *)s, '\0');
|
||||||
len = utf8_ptr2cells(text, end);
|
len = utf8_ptr2cells(text, end);
|
||||||
for (i = 0; i < link->npoints; i++) {
|
for (i = 0; i < link->npoints; i++) {
|
||||||
x = link->points[i].x + dx;
|
x = link->points[i].x + dx;
|
||||||
@ -1270,7 +1270,7 @@ get_form_uri(struct session *ses, struct document_view *doc_view,
|
|||||||
switch (form->method) {
|
switch (form->method) {
|
||||||
case FORM_METHOD_GET:
|
case FORM_METHOD_GET:
|
||||||
{
|
{
|
||||||
unsigned char *pos = strchr(form->action, '#');
|
unsigned char *pos = strchr((const char *)form->action, '#');
|
||||||
|
|
||||||
if (pos) {
|
if (pos) {
|
||||||
add_bytes_to_string(&go, form->action, pos - form->action);
|
add_bytes_to_string(&go, form->action, pos - form->action);
|
||||||
@ -1278,7 +1278,7 @@ get_form_uri(struct session *ses, struct document_view *doc_view,
|
|||||||
add_to_string(&go, form->action);
|
add_to_string(&go, form->action);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strchr(go.source, '?'))
|
if (strchr((const char *)go.source, '?'))
|
||||||
add_char_to_string(&go, '&');
|
add_char_to_string(&go, '&');
|
||||||
else
|
else
|
||||||
add_char_to_string(&go, '?');
|
add_char_to_string(&go, '?');
|
||||||
@ -1519,7 +1519,7 @@ field_op(struct session *ses, struct document_view *doc_view,
|
|||||||
}
|
}
|
||||||
if (utf8) {
|
if (utf8) {
|
||||||
unsigned char *text = fs->value + fs->state;
|
unsigned char *text = fs->value + fs->state;
|
||||||
unsigned char *end = strchr(text, '\0');
|
unsigned char *end = strchr((const char *)text, '\0');
|
||||||
|
|
||||||
utf8_to_unicode(&text, end);
|
utf8_to_unicode(&text, end);
|
||||||
fs->state = (int)(text - fs->value);
|
fs->state = (int)(text - fs->value);
|
||||||
@ -1766,7 +1766,7 @@ field_op(struct session *ses, struct document_view *doc_view,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
text = strchr(fs->value + fs->state, ASCII_LF);
|
text = strchr((const char *)(fs->value + fs->state), ASCII_LF);
|
||||||
if (!text) {
|
if (!text) {
|
||||||
fs->value[fs->state] = '\0';
|
fs->value[fs->state] = '\0';
|
||||||
break;
|
break;
|
||||||
|
@ -1187,7 +1187,7 @@ do_op_right(struct form_state *fs, struct line_info *line, int current, int utf8
|
|||||||
}
|
}
|
||||||
|
|
||||||
text = fs->value + fs->state;
|
text = fs->value + fs->state;
|
||||||
end = strchr(text, '\0');
|
end = strchr((const char *)text, '\0');
|
||||||
old_state = fs->state;
|
old_state = fs->state;
|
||||||
utf8_to_unicode(&text, end);
|
utf8_to_unicode(&text, end);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user