diff options
Diffstat (limited to 'diff-tree.c')
-rw-r--r-- | diff-tree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/diff-tree.c b/diff-tree.c index db37aa714f..a6d358fb34 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -44,10 +44,12 @@ static const unsigned char *extract(void *tree, unsigned long size, const char * int len = strlen(tree)+1; const unsigned char *sha1 = tree + len; const char *path = strchr(tree, ' '); + unsigned int mode; - if (!path || size < len + 20 || sscanf(tree, "%o", modep) != 1) + if (!path || size < len + 20 || sscanf(tree, "%o", &mode) != 1) die("corrupt tree file"); *pathp = path+1; + *modep = DIFF_FILE_CANON_MODE(mode); return sha1; } |