diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2017-11-13 23:54:18 +0100 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2017-11-16 09:33:56 +0100 |
commit | b15c5639299152f526ee95e333198632e0827470 (patch) | |
tree | 0e9fd3fe5607f115a849d2b6c32580e2b9d2120e /package/utils | |
parent | a8a23ca50caec2477e180bdf1f8d040f7824a23b (diff) | |
download | openwrt-b15c5639299152f526ee95e333198632e0827470.tar.gz openwrt-b15c5639299152f526ee95e333198632e0827470.tar.bz2 openwrt-b15c5639299152f526ee95e333198632e0827470.zip |
otrx: always align image to 0x1000
This seems to match what the original trx tool and mjn3's replacement
do.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/utils')
-rw-r--r-- | package/utils/otrx/src/otrx.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/package/utils/otrx/src/otrx.c b/package/utils/otrx/src/otrx.c index 7e117c6e0d..add111aa61 100644 --- a/package/utils/otrx/src/otrx.c +++ b/package/utils/otrx/src/otrx.c @@ -1,7 +1,7 @@ /* * otrx * - * Copyright (C) 2015 Rafał Miłecki <zajec5@gmail.com> + * Copyright (C) 2015-2017 Rafał Miłecki <zajec5@gmail.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -408,6 +408,12 @@ static int otrx_create(int argc, char **argv) { break; } + sbytes = otrx_create_align(trx, curr_offset, 0x1000); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + hdr.length = curr_offset; otrx_create_write_hdr(trx, &hdr); err_close: |