summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-06-20 17:13:13 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-06-20 17:13:13 (GMT)
commit7e5509a260a3573d817d6095dc21d40a94fc9fa8 (patch)
tree24d426a19bf84b3d628f1cc365292fdf27192a32 /Source/MFCDialog
parentfe99b156e5b8ddf34d2635c3c3192cfafd9b63af (diff)
downloadCMake-7e5509a260a3573d817d6095dc21d40a94fc9fa8.zip
CMake-7e5509a260a3573d817d6095dc21d40a94fc9fa8.tar.gz
CMake-7e5509a260a3573d817d6095dc21d40a94fc9fa8.tar.bz2
ENH: avoid crash in sprintf
Diffstat (limited to 'Source/MFCDialog')
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp
index 534f713..0a605f2 100644
--- a/Source/MFCDialog/CMakeSetupDialog.cpp
+++ b/Source/MFCDialog/CMakeSetupDialog.cpp
@@ -83,7 +83,7 @@ void MFCMessageCallback(const char* m, const char* title, bool& nomore, void*)
// CMakeSetupDialog dialog
void updateProgress(const char *msg, float prog, void *cd)
{
- char tmp[1024];
+ char* tmp = new char[strlen(msg) + 40];
if (prog >= 0)
{
sprintf(tmp,"%s %i%%",msg,(int)(100*prog));
@@ -120,6 +120,7 @@ void updateProgress(const char *msg, float prog, void *cd)
break;
}
}
+ delete [] tmp;
}
// Convert to Win32 path (slashes). This calls the system tools one and then