diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-02-21 14:19:14 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2024-02-21 14:19:14 +0200 |
| commit | f88be86978af5ebb92bc9f11e99015afc6b6c4f7 (patch) | |
| tree | 9f1bdb97f57845e32560a9def53bc1ee72c0ed20 /atk16_utils | |
| parent | 43c062225ccf88ef05d51a3c2fccb9f57e8a12c9 (diff) | |
Initial impl of step
Diffstat (limited to 'atk16_utils')
| -rw-r--r-- | atk16_utils/pad_bin.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/atk16_utils/pad_bin.py b/atk16_utils/pad_bin.py index 9f014d1..1c3c24d 100644 --- a/atk16_utils/pad_bin.py +++ b/atk16_utils/pad_bin.py @@ -14,6 +14,9 @@ def pad_binary(file_path, target_size) -> int: # Calculate needed padding padding_size = target_size - current_size + if padding_size < 0: + raise ValueError(f"File is larger than the target size ({current_size} > {target_size}).") + # Append zeros if needed if padding_size > 0: with open(file_path, 'ab') as file: |
