I've always thought that using stl strings was generally safer than char*,
but could anyone comment on the below?

string s = "";
s[2] = 'x';

Am I stomping on random memory with the out-of-range character write, or is
this protected against because it's an stl string?

TaxiDraw currently has a memory corruption bug that only appears on Linux.
It's one of those nasty ones that randomly comes and goes as the source
changes, and appears to be unrelated to the crash site in the debugger.
Apart from converting sprintf -> snprintf, checking for uninitialised
variables, checking for out-of-bounds array writes and running with
valgrind, does anyone have any other suggestions that I could try?

Cheers - Dave

This message has been scanned but we cannot guarantee that it and any
attachments are free from viruses or other damaging content: you are
advised to perform your own checks.  Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

Flightgear-devel mailing list

Reply via email to