"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Klemens Nanni <kn@openbsd.org>
Subject:
diff: Allow 0 context, use GOT_DIFF_MAX_CONTEXT
To:
gameoftrees@openbsd.org
Date:
Fri, 29 Nov 2019 23:02:08 +0100

Download raw body.

Thread
OK?
 
diff e54952f1173d1a102a30a16c4405acced5d8bc4d 8b3a22cb03a4ef23aa3682b0928ead4574fd3aa3
blob - 603a08dbce6fba185a792c4cb606fc4c9e482bce
blob + 756eaa2ea3216dabe5aaf7080a2c652fdbfd0f74
--- got/got.c
+++ got/got.c
@@ -2267,7 +2267,8 @@ cmd_diff(int argc, char *argv[])
 	while ((ch = getopt(argc, argv, "C:r:sw")) != -1) {
 		switch (ch) {
 		case 'C':
-			diff_context = strtonum(optarg, 1, INT_MAX, &errstr);
+			diff_context = strtonum(optarg, 0, GOT_DIFF_MAX_CONTEXT,
+			    &errstr);
 			if (errstr != NULL)
 				err(1, "-C option %s", errstr);
 			break;