$NetBSD: patch-ax,v 1.1 2005/12/20 10:19:09 rillig Exp $

Keywords: ctype

--- src/common/mime.c.orig	Sun Aug 22 22:19:11 2004
+++ src/common/mime.c	Tue Dec 20 11:12:02 2005
@@ -32,12 +32,13 @@
 
 #include "fidogate.h"
 
+#define uchar(c) ((unsigned char) (c))
 
-static int is_qpx		(int);
+static int is_qpx		(unsigned char);
 static int x2toi		(char *);
 
 
-static int is_qpx(int c)
+static int is_qpx(unsigned char c)
 {
     return isxdigit(c) /**is_digit(c) || (c>='A' && c<='F')**/ ;
 }
@@ -48,10 +49,10 @@ static int x2toi(char *s)
     int val = 0;
     int n;
 
-    n = toupper(*s) - (isalpha(*s) ? 'A'-10 : '0');
+    n = toupper(uchar(*s)) - (isalpha(uchar(*s)) ? 'A'-10 : '0');
     val = val*16 + n;
     s++;
-    n = toupper(*s) - (isalpha(*s) ? 'A'-10 : '0');
+    n = toupper(uchar(*s)) - (isalpha(uchar(*s)) ? 'A'-10 : '0');
     val = val*16 + n;
 
     return val;
