TUI: avoid calling strcpy() on identical string objects
authorPatrick Palka <patrick@parcs.ath.cx>
Sat, 25 Apr 2015 14:29:29 +0000 (10:29 -0400)
committerPatrick Palka <patrick@parcs.ath.cx>
Tue, 28 Apr 2015 01:19:58 +0000 (21:19 -0400)
commit2eb639cbe4baa33545ca008d6054ea5db1d8f6a8
tree75913443c4e5dade016d08610cded0bd1451ae2b
parent9720679936fc4f710d718f13d903c7826e048a36
TUI: avoid calling strcpy() on identical string objects

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.

gdb/ChangeLog:

* tui/tui-source.c (tui_set_source_content): Avoid calling
strcpy() when offset is 0.
gdb/ChangeLog
gdb/tui/tui-source.c