U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » strcpy issue
strcpy issue [message #46726] Wed, 20 July 2016 17:44 Go to previous message
forlano is currently offline  forlano
Messages: 1221
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

the following code involving a silly STRCPY crash my application in release mode (upp 9994, 64 bit, gcc , c++11, lubuntu 16.04)

class Team : Moveable<Team> { 
public:
...
    char hstatus[50]; 
...
    Team();
    ~Team(){;}
};

......

sql.Execute("SELECT * FROM TEAMS order by N");
while(sql.Fetch()) {
   Team& t = VTeam.Add( (int)sql[N] );
    ...	
   strcpy (t.hstatus, (String) sql[HSTATUS] );   //<=== crash!
    ...	
}


instead works in debug mode.
On windows, 32 bit, old upp no c++11, it works too.
hstatus cannot be a String (I need to modify its content char by char when needed).

What is wrong in that innocent line?
Thanks,
Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Nightly packages compilation error
Next Topic: Vector(const Vector& v, int)
Goto Forum:
  


Current Time: Tue Apr 28 01:47:42 GMT+2 2026

Total time taken to generate the page: 0.00786 seconds