diff options
Diffstat (limited to 'merge-ll.c')
| -rw-r--r-- | merge-ll.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/merge-ll.c b/merge-ll.c index badb6dea57..62fc625552 100644 --- a/merge-ll.c +++ b/merge-ll.c @@ -15,6 +15,7 @@ #include "merge-ll.h" #include "quote.h" #include "strbuf.h" +#include "gettext.h" struct ll_merge_driver; @@ -334,7 +335,7 @@ static int read_merge_config(const char *var, const char *value, * %X - the revision for our version * %Y - the revision for their version * - * If the file is not named indentically in all versions, then each + * If the file is not named identically in all versions, then each * revision is joined with the corresponding path, separated by a colon. * The external merge driver should write the results in the * file named by %A, and signal that it has done with zero exit @@ -427,7 +428,10 @@ enum ll_merge_result ll_merge(mmbuffer_t *result_buf, git_check_attr(istate, path, check); ll_driver_name = check->items[0].value; if (check->items[1].value) { - marker_size = atoi(check->items[1].value); + if (strtol_i(check->items[1].value, 10, &marker_size)) { + marker_size = DEFAULT_CONFLICT_MARKER_SIZE; + warning(_("invalid marker-size '%s', expecting an integer"), check->items[1].value); + } if (marker_size <= 0) marker_size = DEFAULT_CONFLICT_MARKER_SIZE; } @@ -454,7 +458,10 @@ int ll_merge_marker_size(struct index_state *istate, const char *path) check = attr_check_initl("conflict-marker-size", NULL); git_check_attr(istate, path, check); if (check->items[0].value) { - marker_size = atoi(check->items[0].value); + if (strtol_i(check->items[0].value, 10, &marker_size)) { + marker_size = DEFAULT_CONFLICT_MARKER_SIZE; + warning(_("invalid marker-size '%s', expecting an integer"), check->items[0].value); + } if (marker_size <= 0) marker_size = DEFAULT_CONFLICT_MARKER_SIZE; } |
