summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2022-09-11 16:01:12 +0200
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2023-01-26 19:18:22 +0000
commit1be046b64176206bc5b743f528c61e10dde73de4 (patch)
tree302bd72813f5c00245f85ec11a17e8d1cbe94770
parent0e0afae6579c1efe9f0d85505b75ffe989554133 (diff)
downloadqemu-openbios-1be046b64176206bc5b743f528c61e10dde73de4.tar.gz
Limit binary dump bytes in .properties output
Some device trees can contain large chunks of binary data that result in .properties output to get lost in the dump of all binary bytes. Put an upper limit of the bytes dumped. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r--forth/admin/devices.fs7
1 files changed, 4 insertions, 3 deletions
diff --git a/forth/admin/devices.fs b/forth/admin/devices.fs
index 38f6ad6b..879c2712 100644
--- a/forth/admin/devices.fs
+++ b/forth/admin/devices.fs
@@ -307,15 +307,16 @@
: .p-bytes? ( data len -- 1 | data len 0 )
." -- " dup . ." : "
- swap >r 0
+ swap >r dup 100 min 0
begin 2dup > while
dup r@ + c@
( len n ch )
2 0.r space
1+
- repeat
- 2drop r> drop 1
+ repeat
+ drop > if ." ..." then
+ r> drop 1
;
\ this function tries to heuristically determine the data format