diff --git a/diff-delta.c b/diff-delta.c
index 25a798d050c6319f3d524c9c605ab70ea35ae7a1..8b9172aa2ef7402b0a847815bb11a26d1c4444fe 100644 (file)
--- a/diff-delta.c
+++ b/diff-delta.c
#include <string.h>
#include "delta.h"
#include <string.h>
#include "delta.h"
+#include "git-compat-util.h"
/* maximum hash entry list for the same hash bucket */
#define HASH_LIMIT 64
/* maximum hash entry list for the same hash bucket */
#define HASH_LIMIT 64
const void *src_buf;
unsigned long src_size;
unsigned int hash_mask;
const void *src_buf;
unsigned long src_size;
unsigned int hash_mask;
- struct index_entry *hash[0];
+ struct index_entry *hash[FLEX_ARRAY];
};
struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)
};
struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)
ref_data = index->src_buf;
ref_top = ref_data + index->src_size;
data = trg_buf;
ref_data = index->src_buf;
ref_top = ref_data + index->src_size;
data = trg_buf;
- top = trg_buf + trg_size;
+ top = (const unsigned char *) trg_buf + trg_size;
outpos++;
val = 0;
outpos++;
val = 0;