diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 26d3e5d7af1c9d0f4e0e00143ed157f81ee595d0..f7c8c08b320c99d8bf96443ae57aa33c1de7e8c0 100644 (file)
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
el = strcspn(at, " \n\t\r\v\f>");
strbuf_reset(&email);
strbuf_add(&email, at, el);
- strbuf_remove(&f, at - f.buf, el + 1);
+ strbuf_remove(&f, at - f.buf, el + (at[el] ? 1 : 0));
/* The remainder is name. It could be "John Doe <john.doe@xz>"
* or "john.doe@xz (John Doe)", but we have removed the
return;
out = reencode_string(line->buf, metainfo_charset, charset);
if (!out)
- die("cannot convert from %s to %s\n",
+ die("cannot convert from %s to %s",
charset, metainfo_charset);
strbuf_attach(line, out, strlen(out), strlen(out));
}