summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--diff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 8d7362b62d..8818d09e6c 100644
--- a/diff.c
+++ b/diff.c
@@ -3829,7 +3829,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
else if (!strcmp(arg, "--abbrev"))
options->abbrev = DEFAULT_ABBREV;
else if (skip_prefix(arg, "--abbrev=", &arg)) {
- options->abbrev = strtoul(arg, NULL, 10);
+ if (convert_i(arg, 10, &options->abbrev))
+ die("--abbrev requires an integer argument");
if (options->abbrev < MINIMUM_ABBREV)
options->abbrev = MINIMUM_ABBREV;
else if (40 < options->abbrev)