summaryrefslogtreecommitdiff
path: root/comms/fidogate/patches/patch-ax
blob: b31749885f039f1378d9b16110c199d376f35428 (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-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;