File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -259,9 +259,9 @@ fn readBlock(input: *Reader, allocating: *Writer.Allocating) !void {
259259
260260 // Block Padding
261261 const block_counter = header_size + packed_bytes_read ;
262- const padding = ( 4 - (block_counter % 4 )) % 4 ;
263- for (0 .. padding ) | _ | {
264- if (try input . takeByte () != 0 ) return error .CorruptInput ;
262+ const padding = try input . take ( @intCast (( 4 - (block_counter % 4 )) % 4 )) ;
263+ for (padding ) | byte | {
264+ if (byte != 0 ) return error .CorruptInput ;
265265 }
266266}
267267
@@ -279,14 +279,13 @@ fn finish(d: *Decompress) !void {
279279 if (record_count != d .block_count )
280280 return error .CorruptInput ;
281281
282- for (0.. record_count ) | _ | {
282+ for (0.. @intCast ( record_count ) ) | _ | {
283283 // TODO: validate records
284284 _ = try countLeb128 (input , u64 , & input_counter , & checksum );
285285 _ = try countLeb128 (input , u64 , & input_counter , & checksum );
286286 }
287287
288- const padding_len = (4 - (input_counter % 4 )) % 4 ;
289- const padding = try input .take (padding_len );
288+ const padding = try input .take (@intCast ((4 - (input_counter % 4 )) % 4 ));
290289 for (padding ) | byte | {
291290 if (byte != 0 ) return error .CorruptInput ;
292291 }
You can’t perform that action at this time.
0 commit comments