This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 05/14] Change tui_data_item_window::content to be a unique_xmalloc_ptr


On 8/18/19 6:27 PM, Tom Tromey wrote:
> @@ -309,19 +301,13 @@ tui_data_window::display_registers_from (int start_element_no)
>        int max_len = 0;
>        for (auto &&data_item_win : regs_content)
>          {
> -          char *p;
> +          const char *p;
>            int len;
>  
>            len = 0;
> -          p = data_item_win->content;
> +          p = data_item_win->content.get ();
>            if (p != 0)
> -            while (*p)
> -              {
> -                if (*p++ == '\t')
> -                  len = 8 * ((len / 8) + 1);
> -                else
> -                  len++;
> -              }
> +	    len = strlen (p);
>  

Is this related?  

(Also, I didn't bother to think through whether strlen
is equivalent to the old code.  Is it?)

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]