diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-09-29 16:28:00 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-09-29 16:28:00 +0200 |
| commit | 356f11feeaadb19b6c5acf4e49fa6a17dc7b7a71 (patch) | |
| tree | 08429da02ae70f94391981736073c8ef2ec1e5ba /src/index.c | |
| parent | 780bea6e261cf19cb4bf826de343afcdb362f1b7 (diff) | |
| download | libgit2-356f11feeaadb19b6c5acf4e49fa6a17dc7b7a71.tar.gz | |
index: Silence type-punned warning
Diffstat (limited to 'src/index.c')
| -rw-r--r-- | src/index.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/index.c b/src/index.c index c7bf1a859..7bf5daf2c 100644 --- a/src/index.c +++ b/src/index.c @@ -807,6 +807,7 @@ static int is_index_extended(git_index *index) static int write_disk_entry(git_filebuf *file, git_index_entry *entry) { + void *mem = NULL; struct entry_short *ondisk; size_t path_len, disk_size; char *path; @@ -818,9 +819,11 @@ static int write_disk_entry(git_filebuf *file, git_index_entry *entry) else disk_size = short_entry_size(path_len); - if (git_filebuf_reserve(file, (void **)&ondisk, disk_size) < GIT_SUCCESS) + if (git_filebuf_reserve(file, &mem, disk_size) < GIT_SUCCESS) return GIT_ENOMEM; + ondisk = (struct entry_short *)mem; + memset(ondisk, 0x0, disk_size); /** |
