diff options
-rw-r--r-- | pttbbs/include/proto.h | 4 | ||||
-rw-r--r-- | pttbbs/mbbsd/convert.c | 8 | ||||
-rw-r--r-- | pttbbs/mbbsd/io.c | 4 |
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); } |