OSDN Git Service

segmentation fault 対策
authorRei FURUKAWA <rei_furukawa@users.sourceforge.jp>
Wed, 30 Oct 2002 22:04:50 +0000 (22:04 +0000)
committerRei FURUKAWA <rei_furukawa@users.sourceforge.jp>
Wed, 30 Oct 2002 22:04:50 +0000 (22:04 +0000)
NKF.mod/NKF.xs

index 650cfa5..66e1b31 100644 (file)
@@ -153,7 +153,7 @@ nkf(...)
 
     /* Convestion */
     kanji_convert(NULL);
-    /* nkf_putchar(0);    Null terminator */
+    nkf_putchar(0);     /* Null terminator */
 
     RETVAL = result;
     SvPOK_on(RETVAL);       
@@ -161,7 +161,7 @@ nkf(...)
           SvCUR_set(RETVAL, strlen(output)); 
        because output can contain \0. 
      */
-    SvCUR_set(RETVAL, output_ctr);
+    SvCUR_set(RETVAL, output_ctr - 1);
 
     OUTPUT:
     RETVAL