summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index dd92093..b2e18954 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -139,9 +139,10 @@ static inline ssize_t xwrite(int fd, const void *buf, size_t len)
}
}
-static inline int has_extension(const char *filename, int len, const char *ext)
+static inline int has_extension(const char *filename, const char *ext)
{
- int extlen = strlen(ext);
+ size_t len = strlen(filename);
+ size_t extlen = strlen(ext);
return len > extlen && !memcmp(filename + len - extlen, ext, extlen);
}