diff --git a/librz/cons/histogram.c b/librz/cons/histogram.c index c0f91f376ad..cbae5a390b1 100644 --- a/librz/cons/histogram.c +++ b/librz/cons/histogram.c @@ -691,8 +691,14 @@ static void render_visual_xaxis_ruler(RzStrBuf *buf, const RzHistogramInteractiv if (!tick_cols) { return; } + ut32 space; + if ((data_cols > (ut32)addr_w)) { + space = data_cols - addr_w; + } else { + space = 1; + } for (int t = 0; t < ticks; t++) { - tick_cols[t] = (int)((ut64)t * (data_cols - 1) / (ticks - 1)); + tick_cols[t] = (int)((ut64)t * space / (ticks - 1)); } rz_strbuf_appendf(buf, "%*s", gutter_w, ""); next_tick = 0; diff --git a/test/db/cmd/cmd_interactive_modes b/test/db/cmd/cmd_interactive_modes index 4a230f0745c..7f0a019b9e3 100644 --- a/test/db/cmd/cmd_interactive_modes +++ b/test/db/cmd/cmd_interactive_modes @@ -1,40 +1,40 @@ -NAME=Internal less -FILE== -CMDS=< |  0> | - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces @@ -46,19 +46,19 @@ EXPECT=< [ ...] # Run command via system(3) and pipe its stdout to rizin [?25h EOF -RUN - -NAME=?** entire help string on match -FILE=-- -CMDS=< |  0> | - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' @@ -66,19 +66,19 @@ EXPECT=< [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically Forces use oF '!!' instead. [?25h EOF -RUN - -NAME=?** wrapping -FILE=-- -CMDS=< |  0> | - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' @@ -90,37 +90,37 @@ EXPECT=< # Calculate length of string . Quiet mode stores value in `$?` register. (Quiet mode) [?25h EOF -RUN - -NAME=?**e search -FILE== -CMDS=< |  0> | - analysis.apply.signature: bool - enables/disables auto-applying signatures to the loaded binary (see also flirt  analysis.arch: string,bind - Select the architecture to use [?25h EOF -RUN - -NAME=?*** search -FILE== -CMDS=< |  0> | - ! | Usage: ! [ ...] # Run command via system(3) with raw output. @@ -139,21 +139,21 @@ EXPECT=< # Calculate length of string . Quiet mode stores value in `$?` register. %L | (quiet mode) [?25h EOF -RUN - -NAME=p==v visual histogram interactive (#4431 regression) -FILE=malloc://512 -CMDS=< pd $r @ data.004350f8 - ; XREFS(69) - ;-- data.004350f8: - 0x004350f8 .dword 0x00430000 - ; DATA XREF from fcn.004020d0 @ 0x402108 - ;-- data.004350fc: - 0x004350fc .dword 0x00435420 ; section..sdata - ; DATA XREF from fcn.004020d0 @ 0x402120 - ;-- data.00435100: - 0x00435100 .dword 0x0043396c ; obj.__DTOR_END - ; XREFS(156) - ;-- data.00435104: - 0x00435104 .dword 0x00420000 ; str.ute_get_ADDRESS___from_ADDRE  - ; DATA XREF from sym._init @ 0x402024 - ; DATA XREF from sym._fini @ 0x41ecd0 - ;-- data.00435108: - 0x00435108 .dword 0x00400000 ; segment.LOAD0 ; segment.ehdr - 0x0043510c .dword 0x00000000 - 0x00435110 .dword 0x00000000 - 0x00435114 .dword 0x00000000 - 0x00435118 .dword 0x00000000 - ; DATA XREF from fcn.00414700 @ +0xbb0 - ; DATA XREF from sym.rtnl_open_byproto @ 0x41a878 0.0%[?25h END -EOF -RUN +RUN