summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/grep.c b/grep.c
index b58c7c6434..6c68d5bd2e 100644
--- a/grep.c
+++ b/grep.c
@@ -306,9 +306,9 @@ static NORETURN void compile_regexp_failed(const struct grep_pat *p,
char where[1024];
if (p->no)
- sprintf(where, "In '%s' at %d, ", p->origin, p->no);
+ xsnprintf(where, sizeof(where), "In '%s' at %d, ", p->origin, p->no);
else if (p->origin)
- sprintf(where, "%s, ", p->origin);
+ xsnprintf(where, sizeof(where), "%s, ", p->origin);
else
where[0] = 0;