mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +00:00
(trunk libT) #4700 "compilation fails on FreeBSD because it can't find alloca.h" -- fixed.
This commit is contained in:
parent
5b653e17d4
commit
57d273cd61
1 changed files with 3 additions and 3 deletions
|
@ -16,8 +16,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <alloca.h>
|
||||
|
||||
#include <event2/buffer.h>
|
||||
#include <event2/bufferevent.h>
|
||||
#include <event2/event.h>
|
||||
|
@ -1748,7 +1746,7 @@ updateBlockRequests( tr_peermsgs * msgs )
|
|||
int i;
|
||||
int n;
|
||||
const int numwant = msgs->desiredRequestCount - msgs->peer->pendingReqsToPeer;
|
||||
tr_block_index_t * blocks = alloca( sizeof( tr_block_index_t ) * numwant );
|
||||
tr_block_index_t * blocks = tr_new( tr_block_index_t, numwant );
|
||||
|
||||
tr_peerMgrGetNextRequests( msgs->torrent, msgs->peer, numwant, blocks, &n, false );
|
||||
|
||||
|
@ -1758,6 +1756,8 @@ updateBlockRequests( tr_peermsgs * msgs )
|
|||
blockToReq( msgs->torrent, blocks[i], &req );
|
||||
protocolSendRequest( msgs, &req );
|
||||
}
|
||||
|
||||
tr_free( blocks );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue