From 71012057801fe0cdcf0ab9a136c7259e5409ca0e Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Sun, 8 Aug 2010 22:56:31 +0900 Subject: [PATCH] Fix type of mimeout_state.buf. [nkf-bug:20079] It causes wrong cast. --- nkf.c | 6 +++--- nkf_test.pl | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nkf.c b/nkf.c index 06dfc74..6877afe 100644 --- a/nkf.c +++ b/nkf.c @@ -21,7 +21,7 @@ * 3. This notice may not be removed or altered from any source distribution. */ #define NKF_VERSION "2.1.1" -#define NKF_RELEASE_DATE "2010-04-28" +#define NKF_RELEASE_DATE "2010-08-08" #define COPY_RIGHT \ "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \ "Copyright (C) 1996-2010, The nkf Project." @@ -4635,7 +4635,7 @@ static const char basis_64[] = #define MIMEOUT_BUF_LENGTH 74 static struct { - char buf[MIMEOUT_BUF_LENGTH+1]; + unsigned char buf[MIMEOUT_BUF_LENGTH+1]; int count; } mimeout_state; @@ -4947,7 +4947,7 @@ mime_putc(nkf_char c) i = 0; for (; i < mimeout_state.count - len; ++i) { - if (!strncmp(mimeout_state.buf+i, str, len)) { + if (!strncmp((char *)(mimeout_state.buf+i), str, len)) { i += len - 2; break; } diff --git a/nkf_test.pl b/nkf_test.pl index 91a9af8..30b754b 100644 --- a/nkf_test.pl +++ b/nkf_test.pl @@ -1032,6 +1032,9 @@ printf "%-40s", "[nkf-forum:47334] "; printf "%-40s", "[nkf-bug:20079] "; &test("$nkf -jSxM","\xBB \xBB","=?ISO-2022-JP?B?GyhJOxsoQiAbKEk7GyhC?="); +printf "%-40s", "[nkf-bug:20079] "; + &test("$nkf -SxMw8","\xBB \xBB","=?UTF-8?B?77u/7727IO+9uw==?="); + printf "%-40s", "[nkf-forum:48850] "; &test("$nkf -jSM", "From: \x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0\x82\xA0" . -- 2.11.0