mirror of
https://github.com/transmission/transmission.git
synced 2025-12-19 18:08:31 +00:00
Fix create torrent out-of-range piece size (#4145)
This commit is contained in:
@@ -270,7 +270,7 @@ Gw
|
||||
</textField>
|
||||
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bbO-nc-7cI">
|
||||
<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>
|
||||
<action selector="incrementOrDecrementPieceSize:" target="-2" id="YDm-9R-hMY"/>
|
||||
</connections>
|
||||
|
||||
@@ -360,7 +360,7 @@ NSMutableSet* creatorWindowControllerSet = nil;
|
||||
|
||||
- (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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user