diff options
author | Russell Belfer <arrbee@arrbee.com> | 2012-02-29 13:19:31 -0800 |
---|---|---|
committer | Russell Belfer <arrbee@arrbee.com> | 2012-03-02 15:51:55 -0800 |
commit | da9abdd6a7c05d29b68bb38c6798cd8975a7d26a (patch) | |
tree | 486e7a42243ed65885b1e60a975bc1e770639923 /src | |
parent | 854eccbb2d86c2910f9d98dc52f9ebd0e37c262a (diff) | |
download | libgit2-da9abdd6a7c05d29b68bb38c6798cd8975a7d26a.tar.gz |
Fix a win32 warning message
Diffstat (limited to 'src')
-rw-r--r-- | src/fileops.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fileops.c b/src/fileops.c index 6e45ff8a8..856823afb 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -180,8 +180,11 @@ int git_futils_mmap_ro(git_map *out, git_file fd, git_off_t begin, size_t len) int git_futils_mmap_ro_file(git_map *out, const char *path) { git_file fd = p_open(path, O_RDONLY /* | O_NOATIME */); - size_t len = git_futils_filesize(fd); - int result = git_futils_mmap_ro(out, fd, 0, len); + git_off_t len = git_futils_filesize(fd); + int result; + if (!git__is_sizet(len)) + return git__throw(GIT_ERROR, "File `%s` too large to mmap", path); + result = git_futils_mmap_ro(out, fd, 0, (size_t)len); p_close(fd); return result; } |