Commit Diff


commit - 6d0fee91bc1d9e72a0518facddd23eff96bf2c45
commit + c70c5802a10cb15c75c114dc92c45fa4f32378fd
blob - f1de40ed847f5272eb7980be126095d0f2680fb2
blob + 33c97a707125447b7ba7e9a06bbecf0e1a68b276
--- tog/tog.c
+++ tog/tog.c
@@ -178,7 +178,8 @@ __dead static void
 usage_log(void)
 {
 	endwin();
-	fprintf(stderr, "usage: %s log [-c commit] [-r repository-path] [path]\n",
+	fprintf(stderr,
+	    "usage: %s log [-c commit] [-r repository-path] [path]\n",
 	    getprogname());
 	exit(1);
 }
@@ -295,8 +296,8 @@ draw_commit(struct tog_view *view, struct got_commit_o
 	static const size_t author_display_cols = 16;
 	const int avail = view->ncols;
 
-	if (strftime(datebuf, sizeof(datebuf), "%g/%m/%d ", &commit->tm_committer)
-	    >= sizeof(datebuf))
+	if (strftime(datebuf, sizeof(datebuf), "%g/%m/%d ",
+	    &commit->tm_committer) >= sizeof(datebuf))
 		return got_error(GOT_ERR_NO_SPACE);
 
 	if (avail < date_display_cols)
@@ -886,16 +887,18 @@ show_log_view(struct tog_view *view, struct got_object
 				}
 				break;
 			case KEY_NPAGE: {
-				struct commit_queue_entry *first = first_displayed_entry;
-				err = scroll_down(&first_displayed_entry, view->nlines,
-				    last_displayed_entry, &commits, graph,
-				    repo, in_repo_path);
+				struct commit_queue_entry *first;
+				first = first_displayed_entry;
+				err = scroll_down(&first_displayed_entry,
+				    view->nlines, last_displayed_entry,
+				    &commits, graph, repo, in_repo_path);
 				if (err) {
 					if (err->code != GOT_ERR_ITER_COMPLETED)
 						goto done;
-					/* can't scroll any further; move cursor down */
-					if (first == first_displayed_entry && selected <
-					    MIN(view->nlines - 2, commits.ncommits - 1)) {
+					if (first == first_displayed_entry &&
+					    selected < MIN(view->nlines - 2,
+					    commits.ncommits - 1)) {
+						/* can't scroll further down */
 						selected = MIN(view->nlines - 2,
 						    commits.ncommits - 1);
 					}