git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonas Fonseca <fonseca@diku.dk>
To: git@vger.kernel.org
Subject: [PATCH] describe: fix off-by-one error in --abbrev=40 handling
Date: Fri, 25 Aug 2006 02:48:04 +0200	[thread overview]
Message-ID: <20060825004804.GA4069@diku.dk> (raw)

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---

Possible stupid fix, but shouldn't one be able to say --abbrev=40 if only
once in a life time?

 describe.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/describe.c b/describe.c
index 2b9301f..5dd8b2e 100644
--- a/describe.c
+++ b/describe.c
@@ -42,7 +42,7 @@ static void add_to_known_names(const cha
 	struct commit_name *name = xmalloc(sizeof(struct commit_name) + len);
 
 	name->commit = commit;
-	name->prio = prio; 
+	name->prio = prio;
 	memcpy(name->path, path, len);
 	idx = names;
 	if (idx >= allocs) {
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
 			tags = 1;
 		else if (!strncmp(arg, "--abbrev=", 9)) {
 			abbrev = strtoul(arg + 9, NULL, 10);
-			if (abbrev < MINIMUM_ABBREV || 40 <= abbrev)
+			if (abbrev < MINIMUM_ABBREV || 40 < abbrev)
 				abbrev = DEFAULT_ABBREV;
 		}
 		else

-- 
Jonas Fonseca

                 reply	other threads:[~2006-08-25  0:48 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=20060825004804.GA4069@diku.dk \
    --to=fonseca@diku.dk \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).