blob: 4799dca43da47e4ba965ee0f245d88dcba4b76b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
$NetBSD: patch-ah,v 1.3 2006/10/31 22:33:28 wiz Exp $
--- subreader.c.orig 2006-10-22 22:32:31.000000000 +0000
+++ subreader.c
@@ -74,10 +74,10 @@ static int eol(char p) {
/* Remove leading and trailing space */
static void trail_space(char *s) {
int i = 0;
- while (isspace(s[i])) ++i;
+ while (isspace((unsigned char)s[i])) ++i;
if (i) strcpy(s, s + i);
i = strlen(s) - 1;
- while (i > 0 && isspace(s[i])) s[i--] = '\0';
+ while (i > 0 && isspace((unsigned char)s[i])) s[i--] = '\0';
}
static char *stristr(const char *haystack, const char *needle) {
@@ -628,7 +628,7 @@ static subtitle *sub_read_line_pjs(strea
if (!stream_read_line (st, line, LINE_LEN))
return NULL;
/* skip spaces */
- for (s=line; *s && isspace(*s); s++);
+ for (s=line; *s && isspace(*(unsigned char*)s); s++);
/* allow empty lines at the end of the file */
if (*s==0)
return NULL;
@@ -681,7 +681,7 @@ static subtitle *sub_read_line_mpsub(str
else return current;
}
p=line;
- while (isspace(*p)) p++;
+ while (isspace(*(unsigned char*)p)) p++;
if (eol(*p) && num > 0) return current;
if (eol(*p)) return NULL;
|