I keep getting coredumps when i run this function.
void readUser(int uid) ///Reads users from data directory
{
std::stringstream fileName;
fileName << "./data/" << uid << ".dat";
user myUser;
std::cout << "USERNAME:" << myUser.name << "\n UID:" << myUser.uid;
///Reads data from file
FILE* dat = fopen(fileName.str().c_str(),"rb");
fread(&myUser, sizeof(user), 1, dat);
fclose(dat);
///Copy collected data to bufferUser
strncpy(myUser.name, bufferUser.name, 255);
bufferUser.uid = myUser.uid;
}
Heres a link to the file in question.
https://github.com/JeroenMathon/ColdFusion/blob/Development/src/dataio.cpp