1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 17:47:37 +00:00

use correct value in sizeof

This commit is contained in:
Mitchell Livingston 2008-03-22 18:22:10 +00:00
parent c1f0bb6607
commit e3bd0f0ec7

View file

@ -1382,7 +1382,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
- (void) setFileCheckState: (int) state forIndexes: (NSIndexSet *) indexSet
{
NSUInteger count = [indexSet count], i = 0, index;
tr_file_index_t * files = malloc(count * sizeof(int));
tr_file_index_t * files = malloc(count * sizeof(tr_file_index_t));
for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
{
files[i] = index;
@ -1399,7 +1399,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
- (void) setFilePriority: (int) priority forIndexes: (NSIndexSet *) indexSet
{
NSUInteger count = [indexSet count], i = 0, index;
tr_file_index_t * files = malloc(count * sizeof(int));
tr_file_index_t * files = malloc(count * sizeof(tr_file_index_t));
for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
{
files[i] = index;