[PATCH] TUI: avoid calling strcpy() on indentical string objects

Pedro Alves palves@redhat.com
Mon Apr 27 17:51:00 GMT 2015


On 04/26/2015 04:17 PM, Patrick Palka wrote:
> In tui_set_source_content(), when offset == 0 the source and destination
> pointers of the call to strcpy() are actually the same.  In this case
> not only is strcpy() unnecessary but it is also UB when the two strings
> overlap.

OK.

Boy is that code messy.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list