summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-28 10:50:10 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-28 10:50:10 +0800
commitd75069042bad72002e664fb4f9d83015dcc6d697 (patch)
tree471dc5e15dda3cb649b9be47576a6ac50879f560
parent763cfc92559019ab86318e0a6addd11f739b4c49 (diff)
downloadpttbbs-d75069042bad72002e664fb4f9d83015dcc6d697.tar
pttbbs-d75069042bad72002e664fb4f9d83015dcc6d697.tar.gz
pttbbs-d75069042bad72002e664fb4f9d83015dcc6d697.tar.bz2
pttbbs-d75069042bad72002e664fb4f9d83015dcc6d697.tar.lz
pttbbs-d75069042bad72002e664fb4f9d83015dcc6d697.tar.xz
pttbbs-d75069042bad72002e664fb4f9d83015dcc6d697.tar.zst
pttbbs-d75069042bad72002e664fb4f9d83015dcc6d697.zip
fix error
git-svn-id: http://opensvn.csie.org/pttbbs/branches/victor.gb@1376 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/include/proto.h4
-rw-r--r--pttbbs/mbbsd/convert.c8
-rw-r--r--pttbbs/mbbsd/io.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h
index 00b57d62..63c146a2 100644
--- a/pttbbs/include/proto.h
+++ b/pttbbs/include/proto.h
@@ -278,8 +278,8 @@ int x_dict();
int use_dict(char *dict,char *database);
/* convert */
-char *gb2big(char *s, int plen);
-char *big2gb(char *s, int plen);
+unsigned char *gb2big(unsigned char *s, int plen);
+unsigned char *big2gb(unsigned char *s, int plen);
/* io */
int converting_write(int fd, void *buf, size_t count);
diff --git a/pttbbs/mbbsd/convert.c b/pttbbs/mbbsd/convert.c
index 23cc6b93..c7140d03 100644
--- a/pttbbs/mbbsd/convert.c
+++ b/pttbbs/mbbsd/convert.c
@@ -1,6 +1,6 @@
-
+/* $Id: convert.c 1374 2003-11-27 14:11:40Z victor $ */
/*
- *
+ * The following code is copied and modified from "autoconvert" with GPL.
*/
#include "convert.h"
@@ -53,13 +53,13 @@ static void b2g(char *s)
s[0] = BtoG_bad1; s[1] = BtoG_bad2;
}
-char *gb2big(char *s, int plen)
+signed char *gb2big(unsigned char *s, int plen)
{
unsigned char c = 0;
return hzconvert(s, &plen, &c, g2b);
}
-char *big2gb(char *s, int plen)
+unsigned char *big2gb(unsigned char *s, int plen)
{
unsigned char c = 0;
return hzconvert(s, &plen, &c, b2g);
diff --git a/pttbbs/mbbsd/io.c b/pttbbs/mbbsd/io.c
index 03290f32..273017b8 100644
--- a/pttbbs/mbbsd/io.c
+++ b/pttbbs/mbbsd/io.c
@@ -25,13 +25,13 @@ int converting_read(int fd, void *buf, size_t count)
{
int len = read(fd, buf, count);
if (len >= 0)
- big2gb(buf, count);
+ gb2big(buf, len);
return len;
}
int converting_write(int fd, void *buf, size_t count)
{
- gb2big(buf, count);
+ big2gb(buf, count);
return write(fd, buf, count);
}