@@ -626,7 +626,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
626
626
if (* ptr == '/' ) {
627
627
struct cache_entry * foundce ;
628
628
++ ptr ;
629
- foundce = index_name_exists (& the_index , ce -> name , ptr - ce -> name , ignore_case );
629
+ foundce = index_name_exists (istate , ce -> name , ptr - ce -> name , ignore_case );
630
630
if (foundce ) {
631
631
memcpy ((void * )startPtr , foundce -> name + (startPtr - ce -> name ), ptr - startPtr );
632
632
startPtr = ptr ;
@@ -979,7 +979,7 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti
979
979
if (istate -> cache_nr == istate -> cache_alloc ) {
980
980
istate -> cache_alloc = alloc_nr (istate -> cache_alloc );
981
981
istate -> cache = xrealloc (istate -> cache ,
982
- istate -> cache_alloc * sizeof (struct cache_entry * ));
982
+ istate -> cache_alloc * sizeof (* istate -> cache ));
983
983
}
984
984
985
985
/* Add it in.. */
@@ -1449,7 +1449,7 @@ int read_index_from(struct index_state *istate, const char *path)
1449
1449
istate -> version = ntohl (hdr -> hdr_version );
1450
1450
istate -> cache_nr = ntohl (hdr -> hdr_entries );
1451
1451
istate -> cache_alloc = alloc_nr (istate -> cache_nr );
1452
- istate -> cache = xcalloc (istate -> cache_alloc , sizeof (struct cache_entry * ));
1452
+ istate -> cache = xcalloc (istate -> cache_alloc , sizeof (* istate -> cache ));
1453
1453
istate -> initialized = 1 ;
1454
1454
1455
1455
if (istate -> version == 4 )
0 commit comments