From dd29e2f4321bea25c53af5def7a23fe57640de50 Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Sat, 13 Dec 2025 09:38:53 -0700 Subject: silence new gcc warnings --- text-objects.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'text-objects.c') diff --git a/text-objects.c b/text-objects.c index 5e724b8..37e6980 100644 --- a/text-objects.c +++ b/text-objects.c @@ -176,7 +176,7 @@ static bool text_line_blank(Text *txt, size_t pos) { } Filerange text_object_paragraph(Text *txt, size_t pos) { - char c; + char c = 0; Filerange r; if (text_line_blank(txt, pos)) { Iterator it = text_iterator_get(txt, pos), rit = it; @@ -315,6 +315,10 @@ Filerange text_object_indentation(Text *txt, size_t pos) { size_t line_indent = sol - bol; bool line_empty = text_byte_get(txt, bol, &c) && c == '\n'; + /* NOTE: gcc spits a warning otherwise, this is probably not possible but something + * about how text_line_{begin,start} are implemented makes gcc think otherwise */ + line_indent = MIN(line_indent, PTRDIFF_MAX); + char *buf = text_bytes_alloc0(txt, bol, line_indent); char *tmp = malloc(line_indent); -- cgit v1.2.3