diff --git a/src/struct.ts b/src/struct.ts index 55a319b..f89fd96 100644 --- a/src/struct.ts +++ b/src/struct.ts @@ -190,8 +190,11 @@ export class Struct { } else if (i === this.#properties.length) { // End Of Structure Padding if (this.#size !== null && lastProperty) { - const realSize = this.#roundSize(lastProperty.propertyOffset() + lastProperty.propertySize()); - neededPadding = this.#size - realSize; + const realSize = lastProperty.propertyOffset() + lastProperty.propertySize(); + const realRoundedSize = this.#roundSize(realSize); + if (realRoundedSize !== this.#size) { + neededPadding = this.#size - realSize; + } } } else { // Inner Structure Padding