I just forked a program I'm working on, and recompiled the edited branch, and somehow am losing characters from a std::string passed as a parameter in a function.
ShipWrightLoader shl;
shl.Load("k800.txt", &sh);
when i get inside the function:
void ShipWright::ShipWrightLoader::Load(std::string filename, ShipHull* sh)
{
// function body
}
the filename is truncated to ".txt"
I've tested with a longer filename, and it seems that the string is being split in 2, leaving just the last half of the characters. I'm suspecting some issue with MBS/unicode settings, but am lost as to where to begin the hunt. I should mention that the untouched branch still works just fine, and the forked branch was created by copying the entire solution, renaming the vc2010 project and solutions, and adding my graphics library that the new branch will use(previously it was based in GDI).
EDIT: after more testing it seems even more strange. In the load function, if file loading is unsuccessful a warning is sent to std::cout(redirected to a console window) and the warning prints out the correct filename, using the same parameter string passed into the function.
// further down the load function
if(success)
{
// snipped
}
else
{
std::cout << "Error opening file:" << filename << "\n";
}