describe: fix off-by-one error in --abbrev=40 handling
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jonas Fonseca committed
Aug 25, 2006 at 02:48 UTC
f7122265fcb821208c290ad9817d296dec19d523
1 file changed
+2
-2
describe.c
+2
-2
@@ -42,7 +42,7 @@ static void add_to_known_names(const char *path,
42
struct commit_name *name = xmalloc(sizeof(struct commit_name) + len);
43
44
name->commit = commit;
45
- name->prio = prio;
45
+ name->prio = prio;
46
memcpy(name->path, path, len);
47
idx = names;
48
if (idx >= allocs) {
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
154
tags = 1;
155
else if (!strncmp(arg, "--abbrev=", 9)) {
156
abbrev = strtoul(arg + 9, NULL, 10);
157
- if (abbrev < MINIMUM_ABBREV || 40 <= abbrev)
157
+ if (abbrev < MINIMUM_ABBREV || 40 < abbrev)
158
abbrev = DEFAULT_ABBREV;
159
}
160
else