Skip to content

Commit 260ebe0

Browse files
committed
Fix multi-volume compression to more than 999 volumes
Issue #150
1 parent 619cf67 commit 260ebe0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/internal/cmultivolumeoutstream.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ STDMETHODIMP CMultiVolumeOutStream::Write( const void* data, UInt32 size, UInt32
4141
while ( mCurrentVolumeIndex >= mVolumes.size() ) {
4242
/* The current volume stream still doesn't exist, so we need to create it. */
4343
tstring name = to_tstring( static_cast< uint64_t >( mCurrentVolumeIndex ) + 1 );
44-
name.insert( 0, 3 - name.length(), L'0' );
44+
if ( name.length() < 3 ) {
45+
name.insert( 0, 3 - name.length(), BIT7Z_STRING( '0' ) );
46+
}
4547

4648
fs::path volume_path = mVolumePrefix;
4749
volume_path += BIT7Z_STRING( "." ) + name;

0 commit comments

Comments
 (0)