diff options
author | Linquize <linquize@yahoo.com.hk> | 2013-09-08 13:15:42 +0400 |
---|---|---|
committer | Linquize <linquize@yahoo.com.hk> | 2013-09-19 19:14:06 +0400 |
commit | 66566516ce5171111ea4c5a8160adb4b0b0dc675 (patch) | |
tree | 20d7374e602911f282ddfedf8449c8b8176d85d9 /src/diff.c | |
parent | ef6389ad504037e7a4311adbf14f1fa5a5aa4190 (diff) |
Fix warning
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 3 |
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 */ } |