Ujwal Rao Posted October 7, 2008 Share Posted October 7, 2008 Hi,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 Note: There is nothing wrong with the code as it's working perfectly on other Windows 2000 machines for quite a while now! Link to comment Share on other sites More sharing options...
Ujwal Rao Posted October 16, 2008 Author Share Posted October 16, 2008 could anyone please help me out on this one! Link to comment Share on other sites More sharing options...
schloss Posted October 16, 2008 Share Posted October 16, 2008 As these are all functions from the standard C library, have you tried asking this question in the Programming section of these forums?You might need to provide more precise information, including what language(s) are being used on the affected systems.Link: Programming (C++, Delphi, VB, etc.) Link to comment Share on other sites More sharing options...
cluberti Posted October 16, 2008 Share Posted October 16, 2008 At least some of these are deprecated as of the Visual C 8.0 runtimes (Visual Studio 2005 timeframe), so I'm wondering what kinds of things were installed (or removed) before the problem occurred. APIs don't just "break" . Link to comment Share on other sites More sharing options...
Ujwal Rao Posted October 17, 2008 Author Share Posted October 17, 2008 (edited) Thanks guys for the reply. These APIs have been used in Visual C++ 6.0 I 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 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!cluberti,Could you explain me "so I'm wondering what kinds of things were installed (or removed) before the problem occurred"? Would installing any software cause any problem?I really appreciate your help! Edited October 17, 2008 by Ujwal Rao Link to comment Share on other sites More sharing options...
cluberti Posted October 17, 2008 Share Posted October 17, 2008 Certainly - if someone installed updated C runtimes onto the OS running the app, you could get odd behavior. You should check and see which version of the C runtime redist is installed on machines having the issues. Link to comment Share on other sites More sharing options...
Ujwal Rao Posted October 20, 2008 Author Share Posted October 20, 2008 Thanks Cluberti for the reply. Really appreciate your help!Could you also tell me how to check what version of C runtime installed on a Windows machine - like any command or any app that lets me know? 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