summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-01-27 00:39:25 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-01-27 00:39:25 +0800
commit64e4bd22ba678f49e9c62ce0fea44e4fcb8a871f (patch)
treed8dc43c39f6dec2a1af7726c98f0f61c8a477657
parent1c1d5228d51b8afae2d355026b07dd69831f0e17 (diff)
downloadpttbbs-64e4bd22ba678f49e9c62ce0fea44e4fcb8a871f.tar
pttbbs-64e4bd22ba678f49e9c62ce0fea44e4fcb8a871f.tar.gz
pttbbs-64e4bd22ba678f49e9c62ce0fea44e4fcb8a871f.tar.bz2
pttbbs-64e4bd22ba678f49e9c62ce0fea44e4fcb8a871f.tar.lz
pttbbs-64e4bd22ba678f49e9c62ce0fea44e4fcb8a871f.tar.xz
pttbbs-64e4bd22ba678f49e9c62ce0fea44e4fcb8a871f.tar.zst
pttbbs-64e4bd22ba678f49e9c62ce0fea44e4fcb8a871f.zip
Prevent non-standard C syntax in convert.c
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5527 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/convert.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/convert.c b/pttbbs/mbbsd/convert.c
index d5e75b7c..364384ac 100644
--- a/pttbbs/mbbsd/convert.c
+++ b/pttbbs/mbbsd/convert.c
@@ -13,9 +13,11 @@ convert_write_utf8(VBUF *v, char c) {
// trail must be little endian.
if (trail[1]) {
- trail[0] = c;
int len, i;
- uint16_t ucs = b2u_table[*(uint16_t*)trail];
+ uint16_t ucs;
+
+ trail[0] = c;
+ ucs = b2u_table[*(uint16_t*)trail];
len = ucs2utf(ucs, utf8);
utf8[len] = 0;
@@ -32,6 +34,7 @@ convert_write_utf8(VBUF *v, char c) {
vbuf_add(v, c);
return 1;
}
+
trail[1] = c;
return 0;
}