Ujwal Rao Posted October 17, 2008 Share Posted October 17, 2008 (edited) Hi,FYI, I've posted the same thread inMicrosoft Software Products - Discussion & Support > Windows NT4/2000/2003 also! I was told to post it here too and hence the post!Anyways, here is the problem:I'm working in a product based company and the product is deployed on Windows 2000. Our product has been running at the customers site for quite a while now (say around 2-3 yrs). Suddenly we have started getting a lot of issues with atoi(), itoa(), atof(), atol(), strtod(), strtol(), itoa(), etc APIs. They dont work sometimes and sometimes they result in a crash. We have started replacing all these APIs with sscanf() & sprintf().I want to know why this issue started happening suddenly.Is it because of some windows update/patch that resulted in the crash?Is it because of some hardware issue?Please let me know as this issue has started happening at many of our customer places all over the world and we don't have a clue on this one huh.gifNote: There is nothing wrong with the code as it's working perfectly on other Windows 2000 machines for quite a while now! I've heard a lot about of good things about this forum and greatly appreciate your help!Edit: some more info:We are using VC++ 6.0I know APIs don't break like that..but we have suddenly started getting the issues on these APIs.For Eg:We recently had a crash issue with the following code:virtual void SetDataText(CString &strText, int intAdditionInfo) { m_fdata = atof((LPCSTR)strText);}The same above piece of code was working for more than 2 yrs. Suddenly it has started crashing!!! We would get "Runtime Error" before the crash!We fixed the issue by replacing atof with sscanf:virtual void SetDataText(CString &strText, int intAdditionInfo) { sscanf((LPCSTR)strText, "%f", &m_fdata);}After this there was no more crash! There have been reports of crash on these APIs at different parts of code where they are used! Edited October 29, 2008 by Ujwal Rao Link to comment Share on other sites More sharing options...
Ujwal Rao Posted October 29, 2008 Author Share Posted October 29, 2008 common guys...please help me out on this one! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now