run_qemu.sh: Add format parameter to hex()
Add second (optional) parameter to hex() to control the format of its
output, which follows the typical printf-like formats. If not passed,
the function defaults to its previous behaviour by converting the input
to hexadecimal and prepending the '0x' prefix.
Change-Id: I24ab6ea2f002c67966e2cae43a6c00f82c38c2dc
diff --git a/aarch64/run_qemu.sh b/aarch64/run_qemu.sh
index 19b97d4..ed99af3 100755
--- a/aarch64/run_qemu.sh
+++ b/aarch64/run_qemu.sh
@@ -86,7 +86,7 @@
}
function hex() {
- printf '0x%x\n' $1
+ printf "%${2-#}x\n" $1
}
function template_overlay() {