ENH: avoid crash in sprintf
This commit is contained in:
parent
fe99b156e5
commit
7e5509a260
@ -83,7 +83,7 @@ void MFCMessageCallback(const char* m, const char* title, bool& nomore, void*)
|
|||||||
// CMakeSetupDialog dialog
|
// CMakeSetupDialog dialog
|
||||||
void updateProgress(const char *msg, float prog, void *cd)
|
void updateProgress(const char *msg, float prog, void *cd)
|
||||||
{
|
{
|
||||||
char tmp[1024];
|
char* tmp = new char[strlen(msg) + 40];
|
||||||
if (prog >= 0)
|
if (prog >= 0)
|
||||||
{
|
{
|
||||||
sprintf(tmp,"%s %i%%",msg,(int)(100*prog));
|
sprintf(tmp,"%s %i%%",msg,(int)(100*prog));
|
||||||
@ -120,6 +120,7 @@ void updateProgress(const char *msg, float prog, void *cd)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
delete [] tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert to Win32 path (slashes). This calls the system tools one and then
|
// Convert to Win32 path (slashes). This calls the system tools one and then
|
||||||
|
@ -2369,7 +2369,7 @@ void cmake::GenerateGraphViz(const char* fileName)
|
|||||||
std::map<cmStdString, int> targetDeps;
|
std::map<cmStdString, int> targetDeps;
|
||||||
std::map<cmStdString, cmTarget*> targetPtrs;
|
std::map<cmStdString, cmTarget*> targetPtrs;
|
||||||
std::map<cmStdString, cmStdString> targetNamesNodes;
|
std::map<cmStdString, cmStdString> targetNamesNodes;
|
||||||
char tgtName[100];
|
char tgtName[2048];
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
// First pass get the list of all cmake targets
|
// First pass get the list of all cmake targets
|
||||||
for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
|
for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user