From: Junio C Hamano Date: Sat, 28 Apr 2007 07:15:48 +0000 (-0700) Subject: Do not barf on too long action description X-Git-Tag: v1.5.1.3~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4e6380e5c3af2d8cea8ffac2a7759b4f4e62089b;p=git.git Do not barf on too long action description Reflog message is primarily about easier identification, and leaving truncated entry is much better than dying. Signed-off-by: Junio C Hamano --- diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c index e9d676455..2ad45dcd4 100644 --- a/builtin-fetch--tool.c +++ b/builtin-fetch--tool.c @@ -35,16 +35,13 @@ static int update_ref(const char *action, unsigned char *sha1, unsigned char *oldval) { - int len; char msg[1024]; char *rla = getenv("GIT_REFLOG_ACTION"); static struct ref_lock *lock; 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;