Page MenuHomeFreeBSD

D44801.diff
No OneTemporary

D44801.diff

diff --git a/sys/tools/arm_kernel_boothdr.awk b/sys/tools/arm_kernel_boothdr.awk
--- a/sys/tools/arm_kernel_boothdr.awk
+++ b/sys/tools/arm_kernel_boothdr.awk
@@ -47,6 +47,10 @@
}
gHdrType = hdrtype
+ for (i = 0; i < 16; i++) {
+ hex[sprintf("%x", i)] = i;
+ hex[sprintf("%X", i)] = i;
+ }
}
function addr_to_offset(addr) {
@@ -56,11 +60,13 @@
function hexstr_to_num(str) {
- # Prepend a 0x onto the string, then coerce it to a number by doing
- # arithmetic with it, which makes awk run it through strtod(),
- # which handles hex numbers that have a 0x prefix.
+ sum = 0;
+ len = length(str);
+ for (i = 1; i <= len; i++) {
+ sum = sum * 16 + hex[substr(str, i, 1)];
+ }
- return 0 + ("0x" str)
+ return sum;
}
function write_le32(num) {

File Metadata

Mime Type
text/plain
Expires
Tue, Feb 4, 7:51 PM (20 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16459814
Default Alt Text
D44801.diff (764 B)

Event Timeline