mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[char] More casts to unsigned char
This commit is contained in:
parent
6ea0aa44a1
commit
acbcfd2eba
@ -297,7 +297,7 @@ cached_header_dialog(struct session *ses, struct cache_entry *cached)
|
||||
|
||||
while (cached->head[i]) {
|
||||
/* Check for control chars. */
|
||||
if (cached->head[i] < ' '
|
||||
if ((unsigned char)cached->head[i] < ' '
|
||||
&& cached->head[i] != '\n') {
|
||||
/* Ignore '\r' but replace
|
||||
* other control chars with
|
||||
|
@ -260,7 +260,7 @@ render_dom_attribute_source(struct dom_stack *stack, struct dom_node *node, void
|
||||
for (skips = 0; skips < valuelen; skips++) {
|
||||
if ((quoted && skips == 0)
|
||||
|| isspace(value[skips])
|
||||
|| value[skips] < ' ')
|
||||
|| (unsigned char)value[skips] < ' ')
|
||||
continue;
|
||||
|
||||
break;
|
||||
@ -277,7 +277,7 @@ render_dom_attribute_source(struct dom_stack *stack, struct dom_node *node, void
|
||||
for (skips = 0; skips < valuelen; skips++) {
|
||||
if ((quoted && skips == 0)
|
||||
|| isspace(value[valuelen - skips - 1])
|
||||
|| value[valuelen - skips - 1] < ' ')
|
||||
|| (unsigned char)value[valuelen - skips - 1] < ' ')
|
||||
continue;
|
||||
|
||||
break;
|
||||
|
@ -157,7 +157,7 @@ parse_psv_resp(char *data, int *n, int max_value)
|
||||
|
||||
memset(n, 0, 6 * sizeof(*n));
|
||||
|
||||
if (*p < ' ') return 0;
|
||||
if ((unsigned char)*p < ' ') return 0;
|
||||
|
||||
/* Find the end. */
|
||||
while (*p >= ' ') p++;
|
||||
|
@ -338,7 +338,7 @@ again:
|
||||
int i = 0;
|
||||
|
||||
while (start < e) {
|
||||
n[i++] = (*start < ' ') ? '.' : *start;
|
||||
n[i++] = ((unsigned char)*start < ' ') ? '.' : *start;
|
||||
start++;
|
||||
}
|
||||
n[i] = '\0';
|
||||
|
@ -509,7 +509,7 @@ sanitize_title(char *title)
|
||||
if (!len) return;
|
||||
|
||||
while (len--) {
|
||||
if (title[len] < ' ' || title[len] == NBSP_CHAR)
|
||||
if ((unsigned char)title[len] < ' ' || title[len] == NBSP_CHAR)
|
||||
title[len] = ' ';
|
||||
}
|
||||
trim_chars(title, ' ', NULL);
|
||||
@ -525,7 +525,7 @@ sanitize_url(char *url)
|
||||
if (!len) return 1;
|
||||
|
||||
while (len--) {
|
||||
if (url[len] < ' ')
|
||||
if ((unsigned char)url[len] < ' ')
|
||||
return 0;
|
||||
}
|
||||
trim_chars(url, ' ', NULL);
|
||||
|
@ -187,7 +187,7 @@ get_srch(struct document *document)
|
||||
}
|
||||
|
||||
for (xx = x + 1; xx < width; xx++) {
|
||||
if (document->data[y].chars[xx].data < ' ')
|
||||
if ((unsigned char)document->data[y].chars[xx].data < ' ')
|
||||
continue;
|
||||
count = xx - x;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user