From 140dfce957ed7512bb9c4eed094a78f191e61c07 Mon Sep 17 00:00:00 2001 From: Hiro Date: Wed, 17 May 2006 11:27:39 +0000 Subject: 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 --- libsylph/codeconv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libsylph/codeconv.c') 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]; } -- cgit v1.2.3