Archived

This topic is now archived and is closed to further replies.

EvilCrap

Debug Error?

Recommended Posts

im getting this strange "MVC++ Debug Library" "debug error" when my Win32 DOS Console program terminates, File: i386\chkesp.c "the value of ESP was not properly saved across a function call... ive gotten this in several programs ive made lately... ive been getting this alot... why?

Share this post


Link to post
Share on other sites
I''ve had this problem before (a long time ago) and can''t remember the exact problem - I think it was something to do with not calling function with the right calling convention or something?

Share this post


Link to post
Share on other sites
?? !

i have isolated the code, but, i dont see what the problem is.
i know this is the code, because when i comment it out, no error occurs.

bool Repeat()
{
cout << "would you like to append your order (y/n)?";
char Msg[80]; strset(Msg,'' '');
cin >> Msg;
char Choice = Msg[0];
return ( Choice == ''y'');
}//Repeat rbool

the funny thing, though, is that the error occurs when main terminates.

*****************************************
i managed to fix the problem by re-writtin Repeat,

bool Repeat()
{
cout << "would you like to append your order (y/n)?";
char Choice =0;
cin.get(Choice);
return ( tolower(Choice) == ''y'');
}//Repeat rbool

Share this post


Link to post
Share on other sites
the problem was with strset()
when i did
msg[80];strset(msg,0);
//Msg has no gauranteed null at index 80...
//so strset can run overbounds

Share this post


Link to post
Share on other sites