Commit 3c1f04f18c0c08476bd685984b0fb6801017b11d

Stefan Sperling 2018-09-13T10:16:45

fix infinite loop when tog displays wide characters

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/tog/tog.c b/tog/tog.c
index d302f34..b06d551 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -608,10 +608,9 @@ format_line(wchar_t **wlinep, int *widthp, const char *line, int wlimit)
 			break;
 		case 1:
 		case 2:
-			if (cols + width <= wlimit) {
+			if (cols + width <= wlimit)
 				cols += width;
-				i++;
-			}
+			i++;
 			break;
 		case -1:
 			if (wline[i] == L'\t')