Do not barf on too long action description
- From
Junio C Hamano <junkio@cox.net>
- Date
- Apr 28, 2007, 07:15 UTC
- Message-ID
- <7v3b2lklzv.fsf_-_@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20070428002638.GF18276@pasky.or.cz>
Reflog message is primarily about easier identification, and leaving truncated entry is much better than dying.
Signed-off-by: Junio C Hamano <junkio@cox.net> --- builtin-fetch--tool.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c index 3145c01..1b04881 100644 --- a/builtin-fetch--tool.c +++ b/builtin-fetch--tool.c @@ -42,9 +42,7 @@ static int update_ref(const char *action, if (!rla) rla = "(reflog update)"; - len = snprintf(msg, sizeof(msg), "%s: %s", rla, action); - if (sizeof(msg) <= len) - die("insanely long action"); + snprintf(msg, sizeof(msg), "%s: %s", rla, action); lock = lock_any_ref_for_update(refname, oldval); if (!lock) return 1;