commit | b1a013dd6a79826675138cf9bdfaf18fafa786ba | [log] [tgz] |
---|---|---|
author | René Scharfe <l.s.r@web.de> | Sun Jun 01 11:00:40 2014 +0200 |
committer | Junio C Hamano <gitster@pobox.com> | Mon Jun 02 13:30:18 2014 -0700 |
tree | ea956884bdd7c45a7412d6e28ce510ddae5425cb | |
parent | 7bbc4e8fdb33e0a8e42e77cc05460d4c4f615f4d [diff] |
mailinfo: use strcmp() for string comparison The array header is defined as: static const char *header[MAX_HDR_PARSED] = { "From","Subject","Date", }; When looking for the index of a specfic string in that array, simply use strcmp() instead of memcmp(). This avoids running over the end of the string (e.g. with memcmp("Subject", "From", 7)) and gets rid of magic string length constants. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>