summaryrefslogtreecommitdiffstats
path: root/merge-ll.c
diff options
context:
space:
mode:
Diffstat (limited to 'merge-ll.c')
-rw-r--r--merge-ll.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/merge-ll.c b/merge-ll.c
index 8e63071922..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;
@@ -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;
}