summaryrefslogtreecommitdiff
path: root/ext/nkf
diff options
context:
space:
mode:
Diffstat (limited to 'ext/nkf')
-rw-r--r--ext/nkf/nkf.c2
-rw-r--r--ext/nkf/nkf1.7/nkf.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c
index 35d9295a748..80d0d2e4be1 100644
--- a/ext/nkf/nkf.c
+++ b/ext/nkf/nkf.c
@@ -10,7 +10,7 @@
#undef getc
#undef ungetc
-#define getc(f) (input_ctr>i_len?-1:input[input_ctr++])
+#define getc(f) (input_ctr<i_len?input[input_ctr++]:-1)
#define ungetc(c,f) input_ctr--
#undef putchar
diff --git a/ext/nkf/nkf1.7/nkf.c b/ext/nkf/nkf1.7/nkf.c
index 26ef6570214..09419f40a7c 100644
--- a/ext/nkf/nkf1.7/nkf.c
+++ b/ext/nkf/nkf1.7/nkf.c
@@ -871,7 +871,7 @@ kanji_convert(f)
} else if(c1 == SO) {
shift_mode = TRUE;
NEXT;
- } else if(c1 == ESC ) {
+ } else if(c1 == ESC) {
if((c1 = GETC(f)) == EOF) {
(*oconv)(0, ESC);
LAST;
@@ -1826,6 +1826,7 @@ reinit()
file_out = FALSE;
add_cr = FALSE;
del_cr = FALSE;
+ line = 0;
}
#ifndef PERL_XS