generalize padding funcs
This commit is contained in:
@@ -71,7 +71,7 @@ pub const ShellWriter = struct {
|
||||
});
|
||||
|
||||
fullOffset += len;
|
||||
const padding = pad.roundUp4Padding(u12, fullOffset);
|
||||
const padding = pad.roundUpPadding(u12, 2, fullOffset);
|
||||
fullOffset += padding;
|
||||
//const stderr = std.io.getStdErr().writer();
|
||||
//stderr.print("\n", .{}) catch unreachable;
|
||||
@@ -209,7 +209,7 @@ test "basic shellpopcon" {
|
||||
try testing.expectEqual(sections.getIndex(nobody), null);
|
||||
try testing.expectEqual(
|
||||
sections.sectionBlob().len,
|
||||
pad.roundUp4(u12, bash.len) + pad.roundUp4(u12, zsh.len) + pad.roundUp4(u12, long.len),
|
||||
pad.roundUp(u12, 2, bash.len) + pad.roundUp(u12, 2, zsh.len) + pad.roundUp(u12, 2, long.len),
|
||||
);
|
||||
|
||||
const shellReader = ShellReader.init(
|
||||
|
||||
Reference in New Issue
Block a user