From 1be046b64176206bc5b743f528c61e10dde73de4 Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Sun, 11 Sep 2022 16:01:12 +0200 Subject: 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 Signed-off-by: Mark Cave-Ayland --- forth/admin/devices.fs | 7 ++++--- 1 file 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 -- cgit v1.2.1