{"thread":{"id":"11487","subject":"[PATCH] Fix an off by one bug in pretty.c","startedAt":"2008-01-05T22:55:37Z","lastAt":"2008-01-05T23:18:37Z","messageCount":2,"participants":["Marco Costalba"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"64551","messageId":"e5bfff550801051455i3d589c4q9375aeab0cb6aa47@mail.gmail.com","threadId":"11487","inReplyTo":null,"subject":"[PATCH] Fix an off by one bug in pretty.c","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2008-01-05T22:55:37Z","receivedAt":"2008-01-05T22:55:37Z","isPatch":true,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"In case author email is <> then we have the following\nbug in function 'format_person_part'\n\n/* parse name */\nfor (end = 0; end < len && msg[end] != '<'; end++)\n       ; /* do nothing */\n\nstart = end + 1; /* now start points to '>' */\n\n-- cut ---\n\n/* parse email */\nfor (end = start + 1; end < len && msg[end] != '>'; end++)\n\nAnd here 'end' is initialized with 'start + 1'\ninstead of 'start'. This turns out in empty commit\ndate when git log is used with --pretty=format option.\n\nSigned-off-by: Marco Costalba <mcostalba@gmail.com>\n---\n pretty.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/pretty.c b/pretty.c\nindex 5b1078b..0b2f187 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -292,7 +292,7 @@ static void format_person_part\n \t/* parse name */\n \tfor (end = 0; end < len && msg[end] != '<'; end++)\n \t\t; /* do nothing */\n-\tstart = end + 1;\n+\tstart = end;\n \twhile (end > 0 && isspace(msg[end - 1]))\n \t\tend--;\n \tif (part == 'n') {\t/* name */\n-- \n1.5.4.rc2.38.gd6da3-dirty\n"},{"id":"64553","messageId":"e5bfff550801051518u49e9c21ake36584457f4c9488@mail.gmail.com","threadId":"11487","inReplyTo":"e5bfff550801051455i3d589c4q9375aeab0cb6aa47@mail.gmail.com","subject":"Re: [PATCH] Fix an off by one bug in pretty.c","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2008-01-05T23:18:37Z","receivedAt":"2008-01-05T23:18:37Z","isPatch":true,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On Jan 5, 2008 11:55 PM, Marco Costalba <mcostalba@gmail.com> wrote:\n> In case author email is <> then we have the following\n> bug in function 'format_person_part'\n>\n\nWARNING: Please discard previous patch!\n\nDue to an error I sent the wrong one, the following is the correct one:\n\n------------------- CUT ----------------------------------------------------\n\n\nIn case author email is <> then we have the following\nbug in function 'format_person_part'\n\n/* parse name */\nfor (end = 0; end < len && msg[end] != '<'; end++)\n      ; /* do nothing */\n\nstart = end + 1; /* now start points to '>' */\n\n-- cut ---\n\n/* parse email */\nfor (end = start + 1; end < len && msg[end] != '>'; end++)\n\nAnd here 'end' is initialized with 'start + 1'\ninstead of 'start'. This turns out in empty commit\ndate when git log is used with --pretty=format option.\n\nSigned-off-by: Marco Costalba <mcostalba@gmail.com>\n---\n\nfeba083ccd11374560e34a755ca03f07e7d45533\n pretty.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/pretty.c b/pretty.c\nindex 5b1078b..3ce5e6f 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -304,7 +304,7 @@ static void format_person_part\n \t\treturn;\n\n \t/* parse email */\n-\tfor (end = start + 1; end < len && msg[end] != '>'; end++)\n+\tfor (end = start; end < len && msg[end] != '>'; end++)\n \t\t; /* do nothing */\n\n \tif (end >= len)\n"}]}