aboutsummaryrefslogtreecommitdiff
path: root/libsylph/codeconv.c
diff options
context:
space:
mode:
authorHiro <Hiro@ee746299-78ed-0310-b773-934348b2243d>2006-05-17 11:27:39 +0000
committerHiro <Hiro@ee746299-78ed-0310-b773-934348b2243d>2006-05-17 11:27:39 +0000
commit140dfce957ed7512bb9c4eed094a78f191e61c07 (patch)
tree6129c1c5a5e77d0fd8465ee46a9bab63e414a945 /libsylph/codeconv.c
parent755f97a9347ce09369cc6f6949c899de6b8acdc5 (diff)
fixed execution failure when using accessibility module, and character corruption and buffer overflow on sending when using half-width kana.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1068 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/codeconv.c')
-rw-r--r--libsylph/codeconv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libsylph/codeconv.c b/libsylph/codeconv.c
index 76d75336..d7c726f0 100644
--- a/libsylph/codeconv.c
+++ b/libsylph/codeconv.c
@@ -587,7 +587,7 @@ static gchar *conv_sjistojis(const gchar *inbuf, gint *error)
gint error_ = 0;
guint idx;
- outbuf = g_malloc(strlen(inbuf) * 3 + 4);
+ outbuf = g_malloc(strlen(inbuf) * 5 + 4);
out = (guchar *)outbuf;
while (*in != '\0') {
@@ -614,7 +614,6 @@ static gchar *conv_sjistojis(const gchar *inbuf, gint *error)
} else if (issjishwkana(*in)) {
if (prefs_common.allow_jisx0201_kana) {
HW_IN();
- in++;
*out++ = *in++ & 0x7f;
} else {
guchar jis_ch[2];
@@ -629,10 +628,10 @@ static gchar *conv_sjistojis(const gchar *inbuf, gint *error)
(jis_ch,
*in, '\0');
if (len == 0)
- in += 2;
+ in++;
else {
K_IN();
- in += len * 2;
+ in += len;
*out++ = jis_ch[0];
*out++ = jis_ch[1];
}