diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-08-08 16:56:28 -0700 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-08-08 16:56:28 -0700 |
| commit | f6867e639a963726f381739314ea7a9d181c5aae (patch) | |
| tree | 29ab8bbd4fbe1532853b2c50b806431354499335 /src/indexer.c | |
| parent | 09df3f2c0f72dbcf206cc48f508919e03671a946 (diff) | |
| download | libgit2-f6867e639a963726f381739314ea7a9d181c5aae.tar.gz | |
Fix compilation in Windows
Diffstat (limited to 'src/indexer.c')
| -rw-r--r-- | src/indexer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/indexer.c b/src/indexer.c index 7a2b28ae3..fcc0229e3 100644 --- a/src/indexer.c +++ b/src/indexer.c @@ -104,8 +104,10 @@ int git_indexer_new(git_indexer **out, const char *packname) namelen = strlen(packname); idx->pack = git__malloc(sizeof(struct git_pack_file) + namelen + 1); - if (idx->pack == NULL) + if (idx->pack == NULL) { + error = GIT_ENOMEM; goto cleanup; + } memset(idx->pack, 0x0, sizeof(struct git_pack_file)); memcpy(idx->pack->pack_name, packname, namelen + 1); @@ -127,7 +129,7 @@ int git_indexer_new(git_indexer **out, const char *packname) } idx->pack->mwf.fd = ret; - idx->pack->mwf.size = idx->st.st_size; + idx->pack->mwf.size = (git_off_t)idx->st.st_size; error = parse_header(idx); if (error < GIT_SUCCESS) { @@ -170,7 +172,7 @@ int git_indexer_write(git_indexer *idx) { git_mwindow *w = NULL; int error, namelen; - unsigned int i, long_offsets, left; + unsigned int i, long_offsets = 0, left; struct git_pack_idx_header hdr; char filename[GIT_PATH_MAX]; struct entry *entry; |
