mirror of
https://github.com/transmission/transmission
synced 2025-01-03 13:35:36 +00:00
Fix create torrent out-of-range piece size (#4145)
This commit is contained in:
parent
ff2e544a6b
commit
b322971f6a
2 changed files with 2 additions and 2 deletions
|
@ -270,7 +270,7 @@ Gw
|
||||||
</textField>
|
</textField>
|
||||||
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bbO-nc-7cI">
|
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bbO-nc-7cI">
|
||||||
<rect key="frame" x="672" y="81" width="19" height="28"/>
|
<rect key="frame" x="672" y="81" width="19" height="28"/>
|
||||||
<stepperCell key="cell" alignment="left" minValue="1" maxValue="1000" doubleValue="1" autorepeat="NO" id="53C-Ri-3gc"/>
|
<stepperCell key="cell" alignment="left" minValue="14" maxValue="31" doubleValue="14" autorepeat="NO" id="53C-Ri-3gc"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="incrementOrDecrementPieceSize:" target="-2" id="YDm-9R-hMY"/>
|
<action selector="incrementOrDecrementPieceSize:" target="-2" id="YDm-9R-hMY"/>
|
||||||
</connections>
|
</connections>
|
||||||
|
|
|
@ -360,7 +360,7 @@ NSMutableSet* creatorWindowControllerSet = nil;
|
||||||
|
|
||||||
- (IBAction)incrementOrDecrementPieceSize:(id)sender
|
- (IBAction)incrementOrDecrementPieceSize:(id)sender
|
||||||
{
|
{
|
||||||
auto const piece_size = static_cast<uint32_t>(pow(2.0, [sender intValue]));
|
uint32_t const piece_size = 1U << [(NSStepper*)sender intValue];
|
||||||
|
|
||||||
if (self.fBuilder->setPieceSize(piece_size))
|
if (self.fBuilder->setPieceSize(piece_size))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue