$NetBSD: patch-ah,v 1.2 2010/09/11 13:29:40 cheusov Exp $

--- subreader.c.orig	2010-08-29 11:27:00.000000000 +0000
+++ subreader.c
@@ -94,10 +94,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) {
@@ -725,7 +725,7 @@ static subtitle *sub_read_line_pjs(strea
     if (!stream_read_line (st, line, LINE_LEN, utf16))
 	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;
@@ -778,7 +778,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;
 
@@ -1824,18 +1824,18 @@ char * strreplace( char * in,char * what
 static void strcpy_trim(char *d, char *s)
 {
     // skip leading whitespace
-    while (*s && isspace(*s)) {
+    while (*s && isspace((unsigned char)*s)) {
 	s++;
     }
     for (;;) {
 	// copy word
-	while (*s && !isspace(*s)) {
+	while (*s && !isspace((unsigned char)*s)) {
 	    *d = tolower(*s);
 	    s++; d++;
 	}
 	if (*s == 0) break;
 	// trim excess whitespace
-	while (*s && isspace(*s)) {
+	while (*s && isspace((unsigned char)*s)) {
 	    s++;
 	}
 	if (*s == 0) break;
@@ -1874,7 +1874,7 @@ static void strcpy_get_ext(char *d, char
 static int whiteonly(char *s)
 {
     while (*s) {
-	if (!isspace(*s)) return 0;
+	if (!isspace((unsigned char)*s)) return 0;
 	s++;
   }
     return 1;
