jirentabu / crashrpt

Automatically exported from code.google.com/p/crashrpt
0 stars 0 forks source link

Format() called with CString arguments #161

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
While it seems to work fine, calling variadic funtions with non-POD types as 
variable arguments is undefined behavior. I assume that the VS compilers use 
the LPCTSTR cast implicitly but I am unsure whether this is true for other 
compilers.
You might consider changing calls like

sEventName.Format(_T("Local\\CrashRptEvent_%s"), eri.m_sCrashGUID);

in CrashInfoReader.cpp to

 sEventName.Format(_T("Local\\CrashRptEvent_%s"), (LPCTSTR) eri.m_sCrashGUID);

There are a few dozens of other occurrences of the same issue.

Original issue reported on code.google.com by Schoenle...@googlemail.com on 24 Jul 2012 at 9:28

GoogleCodeExporter commented 9 years ago
I use calls like this in all my projects and never had any problem with them. 
CrashRpt is designed for Visual C++ compiler. For now, there are no plans to 
compile it with other compilers. 

Original comment by zexspect...@gmail.com on 26 Aug 2012 at 4:05