Commit 0ce35b66957ca0c2d19ae9833da0a3e607425d94

Stefan Sperling 2022-06-16T13:36:46

fix an off-by-one in tog's draw_file() causing wrong diff output This issue caused empty lines added in diffs to be displayed without leading + in the diff view. Problem found by op@ ok op jamsek

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/tog/tog.c b/tog/tog.c
index 61e731b..1900350 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -3242,7 +3242,7 @@ draw_file(struct tog_view *view, const char *header)
 				free(line);
 				return err;
 			}
-			if (view->x < width - 1)
+			if (view->x < width)
 				waddwstr(view->window, wline + view->x);
 			free(wline);
 			wline = NULL;