summaryrefslogtreecommitdiff
path: root/builtin/mailinfo.c
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2014-09-21 09:13:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-09-22 20:46:43 (GMT)
commit85de86a16bd853708658eb13689d913bc377ae3e (patch)
tree117cad9a185c2229d5b03fa597d554629533c17e /builtin/mailinfo.c
parent2da1f36671c3e3e28eba6a56d92249b6671c07d3 (diff)
downloadgit-85de86a16bd853708658eb13689d913bc377ae3e.zip
git-85de86a16bd853708658eb13689d913bc377ae3e.tar.gz
git-85de86a16bd853708658eb13689d913bc377ae3e.tar.bz2
mailinfo: work around -Wstring-plus-int warning
The just-released Apple Xcode 6.0.1 has -Wstring-plus-int enabled by default which complains about pointer arithmetic applied to a string literal: builtin/mailinfo.c:303:24: warning: adding 'long' to a string does not append to the string return !memcmp(SAMPLE + (cp - line), cp, strlen(SAMPLE) ... ~~~~~~~^~~~~~~~~~~~~ Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/mailinfo.c')
-rw-r--r--builtin/mailinfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index 2632fb0..6a14d29 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -288,9 +288,10 @@ static inline int cmp_header(const struct strbuf *line, const char *hdr)
line->buf[len] == ':' && isspace(line->buf[len + 1]);
}
-#define SAMPLE "From e6807f3efca28b30decfecb1732a56c7db1137ee Mon Sep 17 00:00:00 2001\n"
static int is_format_patch_separator(const char *line, int len)
{
+ static const char SAMPLE[] =
+ "From e6807f3efca28b30decfecb1732a56c7db1137ee Mon Sep 17 00:00:00 2001\n";
const char *cp;
if (len != strlen(SAMPLE))