[commit] r2389 - trunk/GME/MgaUtil
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Thu Oct 17 15:19:48 CDT 2013
Author: ksmyth
Date: Thu Oct 17 15:19:48 2013
New Revision: 2389
Log:
GME-428 fix pattern registration errors
Modified:
trunk/GME/MgaUtil/CompDlg.cpp
trunk/GME/MgaUtil/CompInfoDlg.cpp
Modified: trunk/GME/MgaUtil/CompDlg.cpp
==============================================================================
--- trunk/GME/MgaUtil/CompDlg.cpp Wed Oct 16 12:35:28 2013 (r2388)
+++ trunk/GME/MgaUtil/CompDlg.cpp Thu Oct 17 15:19:48 2013 (r2389)
@@ -530,7 +530,7 @@
dlg.m_filename = path;
TCHAR paren, info[200] = {0};
- if(_stscanf_s(CString(buf), _T(" $!COMMENT( %[^)]%c"), info, &paren) != 2 || paren != ')') {
+ if (swscanf_s(CString(buf), _T(" $!COMMENT( %[^)]%lc"), info, (unsigned)(sizeof(info)/sizeof(info[0]))-1, &paren, 1) != 2 || paren != ')') {
nothing_understood:
AfxMessageBox("Cannot read component info in file " + path);
}
@@ -618,9 +618,9 @@
COMTHROW(registrar->put_ComponentExtraInfo(acmode, progid, CComBSTR(L"ScriptFile"), CComBSTR(path)));
COMTHROW(registrar->put_ComponentExtraInfo(acmode, progid, CComBSTR(L"ScriptVersion"), CComBSTR(dlg.m_version)));
- TCHAR *mpardup = (TCHAR *)alloca((dlg.m_paradigm.GetLength()+1)*sizeof(TCHAR));
- _tcscpy(mpardup, dlg.m_paradigm);
- const TCHAR *par = _tcstok(mpardup,_T("\t ,"));
+ std::unique_ptr<TCHAR[]> mpardup(new TCHAR[dlg.m_paradigm.GetLength()+1]);
+ _tcscpy(mpardup.get(), dlg.m_paradigm);
+ const TCHAR *par = _tcstok(mpardup.get(), _T("\t ,"));
while(par) {
COMTHROW(registrar->Associate(progid, CComBSTR(par), acmode));
par = _tcstok(NULL, _T("\t ,"));
Modified: trunk/GME/MgaUtil/CompInfoDlg.cpp
==============================================================================
--- trunk/GME/MgaUtil/CompInfoDlg.cpp Wed Oct 16 12:35:28 2013 (r2388)
+++ trunk/GME/MgaUtil/CompInfoDlg.cpp Thu Oct 17 15:19:48 2013 (r2389)
@@ -65,6 +65,10 @@
else if(_stscanf_s(m_version, _T("%d"), &v) != 1 || v <= 0) {
AfxMessageBox(_T("Version ID must start with a number > 0"));
}
+ else if (m_execeng.GetCurSel() == -1)
+ {
+ AfxMessageBox(_T("No execution engine selected"));
+ }
else {
m_execeng.GetLBText(m_execeng.GetCurSel(),engine);
CDialog::OnOK();
More information about the gme-commit
mailing list