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 --- ChangeLog | 6 ++++++ libsylph/codeconv.c | 7 +++---- src/main.c | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f80993b9..0f9c3160 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-05-17 + + * src/main.c: fixed execution failure when using accessibility module. + * libsylph/codeconv.c: conv_sjistojis(): fixed character corruption + and buffer overflow when using half-width kana. + 2006-05-09 * src/summaryview.c: don't decrease new/unread count if zero. 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]; } diff --git a/src/main.c b/src/main.c index ff62ce31..37e8088e 100644 --- a/src/main.c +++ b/src/main.c @@ -188,7 +188,8 @@ int main(int argc, char *argv[]) gtk_widget_set_default_visual(gdk_rgb_get_visual()); #if USE_THREADS || USE_LDAP - g_thread_init(NULL); + if (!g_thread_supported()) + g_thread_init(NULL); if (!g_thread_supported()) g_error(_("g_thread is not supported by glib.\n")); #endif -- cgit v1.2.3