mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-06 20:45:54 +01:00
when copying strings between structs, realloc, don't just copy ptrs.
This commit is contained in:
parent
ef15f50edf
commit
11d6f7417e
1 changed files with 6 additions and 2 deletions
|
@ -22,8 +22,12 @@ public class LocalPlayer {
|
||||||
{
|
{
|
||||||
isLocal = src.isLocal;
|
isLocal = src.isLocal;
|
||||||
isRobot = src.isRobot;
|
isRobot = src.isRobot;
|
||||||
name = src.name;
|
if ( null != src.name ) {
|
||||||
password = src.password;
|
name = new String(src.name);
|
||||||
|
}
|
||||||
|
if ( null != src.password ) {
|
||||||
|
password = new String(src.password);
|
||||||
|
}
|
||||||
secondsUsed = src.secondsUsed;
|
secondsUsed = src.secondsUsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue