|
|
|
@ -294,7 +294,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
@@ -294,7 +294,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
|
|
|
|
|
if (opt->pre_context) { |
|
|
|
|
push_arg("-B"); |
|
|
|
|
len += snprintf(argptr, sizeof(randarg)-len, |
|
|
|
|
"%u", opt->pre_context); |
|
|
|
|
"%u", opt->pre_context) + 1; |
|
|
|
|
if (sizeof(randarg) <= len) |
|
|
|
|
die("maximum length of args exceeded"); |
|
|
|
|
push_arg(argptr); |
|
|
|
@ -303,7 +303,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
@@ -303,7 +303,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
|
|
|
|
|
if (opt->post_context) { |
|
|
|
|
push_arg("-A"); |
|
|
|
|
len += snprintf(argptr, sizeof(randarg)-len, |
|
|
|
|
"%u", opt->post_context); |
|
|
|
|
"%u", opt->post_context) + 1; |
|
|
|
|
if (sizeof(randarg) <= len) |
|
|
|
|
die("maximum length of args exceeded"); |
|
|
|
|
push_arg(argptr); |
|
|
|
@ -313,7 +313,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
@@ -313,7 +313,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
|
|
|
|
|
else { |
|
|
|
|
push_arg("-C"); |
|
|
|
|
len += snprintf(argptr, sizeof(randarg)-len, |
|
|
|
|
"%u", opt->post_context); |
|
|
|
|
"%u", opt->post_context) + 1; |
|
|
|
|
if (sizeof(randarg) <= len) |
|
|
|
|
die("maximum length of args exceeded"); |
|
|
|
|
push_arg(argptr); |
|
|
|
|