All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - clang: ensure new_len is at least 1
Date: Mon, 20 Sep 2021 13:29:47 +0000 (GMT)	[thread overview]
Message-ID: <20210920132947.4E41F3858C60@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=834f17bb3388ffe7f51aeede15d957a63bcda715
Commit:        834f17bb3388ffe7f51aeede15d957a63bcda715
Parent:        0d9f3dbd954b04e08a27154376b60fe9aca23b0c
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Mon Sep 20 10:17:50 2021 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Mon Sep 20 10:51:30 2021 +0200

clang: ensure new_len is at least 1

---
 test/unit/run.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/unit/run.c b/test/unit/run.c
index 9cbb60506..206857159 100644
--- a/test/unit/run.c
+++ b/test/unit/run.c
@@ -125,7 +125,9 @@ static void _print_path_delta(FILE *stream,
 			fprintf(stream, "\n");
 	}
 
-	len = common_prefix * 2 + (new[new_len - 1].e - new[new_len - 1].b);
+	if (new_len > 0)
+		len = common_prefix * 2 + (new[new_len - 1].e - new[new_len - 1].b);
+
 	fprintf(stream, "  ");
 	for (d = len; d < 60; d++)
 		fprintf(stream, ".");



                 reply	other threads:[~2021-09-20 13:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210920132947.4E41F3858C60@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.