diff --git a/builtin-log.c b/builtin-log.c
index 617aa67f2b2d1fd82c34eea62fd73145ff646ae0..911fd659906ebe87bf0adcd17519dd97777fb948 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
static void add_header(const char *value)
{
int len = strlen(value);
static void add_header(const char *value)
{
int len = strlen(value);
- while (value[len - 1] == '\n')
+ while (len && value[len - 1] == '\n')
len--;
if (!strncasecmp(value, "to: ", 4)) {
ALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);
len--;
if (!strncasecmp(value, "to: ", 4)) {
ALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);
@@ -1082,7 +1082,7 @@ static int add_pending_commit(const char *arg, struct rev_info *revs, int flags)
}
static const char cherry_usage[] =
}
static const char cherry_usage[] =
-"git-cherry [-v] <upstream> [<head>] [<limit>]";
+"git cherry [-v] <upstream> [<head>] [<limit>]";
int cmd_cherry(int argc, const char **argv, const char *prefix)
{
struct rev_info revs;
int cmd_cherry(int argc, const char **argv, const char *prefix)
{
struct rev_info revs;