shithub: neatroff

Download patch

ref: 93691381ddd563a675b962970ea135bc89489dd4
parent: f22eca6a0b1783231b743d550fc38035fc4bcd5c
author: Ali Gholami Rudi <ali@rudi.ir>
date: Tue Jul 1 20:59:02 EDT 2014

hyph: stop at NARGS in tr_hcode()

--- a/hyph.c
+++ b/hyph.c
@@ -186,12 +186,11 @@
 void tr_hcode(char **args)
 {
 	int i = 1;
-	while (args[i] && args[i + 1] && hcode_n < NHCODES) {
-		strcpy(hcodesrc[hcode_n], args[i]);
-		strcpy(hcodedst[hcode_n], args[i + 1]);
+	while (i + 1 <= NARGS && args[i + 1] && hcode_n < NHCODES) {
+		strcpy(hcodesrc[hcode_n], args[i++]);
+		strcpy(hcodedst[hcode_n], args[i++]);
 		dict_put(&hcodedict, hcodesrc[hcode_n], hcode_n);
 		hcode_n++;
-		i += 2;
 	}
 }