Use #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
2
apply.c
2
apply.c
@ -651,7 +651,7 @@ static int parse_git_header(char *line, int len, unsigned int size, struct patch
|
||||
len = linelen(line, size);
|
||||
if (!len || line[len-1] != '\n')
|
||||
break;
|
||||
for (i = 0; i < sizeof(optable) / sizeof(optable[0]); i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(optable); i++) {
|
||||
const struct opentry *p = optable + i;
|
||||
int oplen = strlen(p->str);
|
||||
if (len < oplen || memcmp(p->str, line, oplen))
|
||||
|
||||
Reference in New Issue
Block a user