summaryrefslogtreecommitdiff
path: root/src/diff.c
diff options
context:
space:
mode:
authorLinquize <linquize@yahoo.com.hk>2013-09-08 17:15:42 +0800
committerLinquize <linquize@yahoo.com.hk>2013-09-19 23:14:06 +0800
commit66566516ce5171111ea4c5a8160adb4b0b0dc675 (patch)
tree20d7374e602911f282ddfedf8449c8b8176d85d9 /src/diff.c
parentef6389ad504037e7a4311adbf14f1fa5a5aa4190 (diff)
downloadlibgit2-66566516ce5171111ea4c5a8160adb4b0b0dc675.tar.gz
Fix warning
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/diff.c b/src/diff.c
index 77dbbd8bc..28f5f93e3 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -440,7 +440,8 @@ static int diff_list_apply_options(
/* If not given explicit `opts`, check `diff.xyz` configs */
if (!opts) {
- diff->opts.context_lines = config_int(cfg, "diff.context", 3);
+ int context = config_int(cfg, "diff.context", 3);
+ diff->opts.context_lines = context >= 0 ? (uint16_t)context : 3;
/* add other defaults here */
}