OSDN Git Service

Fix type of mimeout_state.buf. [nkf-bug:20079]
authorNARUSE, Yui <naruse@users.sourceforge.jp>
Sun, 8 Aug 2010 13:56:31 +0000 (22:56 +0900)
committerNARUSE, Yui <naruse@users.sourceforge.jp>
Sun, 8 Aug 2010 13:56:31 +0000 (22:56 +0900)
It causes wrong cast.

nkf.c
nkf_test.pl

diff --git a/nkf.c b/nkf.c
index 06dfc74..6877afe 100644 (file)
--- 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;
                        }
index 91a9af8..30b754b 100644 (file)
@@ -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" .