diff options
| author | oy <Tom_Adams@web.de> | 2010-12-07 23:47:41 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-12-07 23:47:41 +0100 |
| commit | 7414271309433d7501fb6d7731ee3dd38df72dd1 (patch) | |
| tree | af89498a7d7562c75d11b920e4f66c4b99d235fb /src | |
| parent | c3966413e9f9c612fb26cfb2d0a20d85aa136df9 (diff) | |
| download | zcatch-7414271309433d7501fb6d7731ee3dd38df72dd1.tar.gz zcatch-7414271309433d7501fb6d7731ee3dd38df72dd1.zip | |
check the return values of RemoveFile and CreateFolder
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/client/components/menus_demo.cpp | 8 | ||||
| -rw-r--r-- | src/game/editor/ed_editor.cpp | 14 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index a96659d8..7d7e2903 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -484,9 +484,11 @@ void CMenus::RenderDemoList(CUIRect MainView) { char aBuf[512]; str_format(aBuf, sizeof(aBuf), "%s/%s", m_aCurrentDemoFolder, m_lDemos[m_DemolistSelectedIndex].m_aFilename); - Storage()->RemoveFile(aBuf, m_lDemos[m_DemolistSelectedIndex].m_StorageType); - DemolistPopulate(); - DemolistOnUpdate(false); + if(Storage()->RemoveFile(aBuf, m_lDemos[m_DemolistSelectedIndex].m_StorageType)) + { + DemolistPopulate(); + DemolistOnUpdate(false); + } } m_DemolistDelEntry = false; } diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp index c59c1ff4..bb9a1721 100644 --- a/src/game/editor/ed_editor.cpp +++ b/src/game/editor/ed_editor.cpp @@ -2359,12 +2359,14 @@ void CEditor::RenderFileDialog() { char aBuf[512]; str_format(aBuf, sizeof(aBuf), "%s/%s", m_pFileDialogPath, m_aFileDialogFileName); - Storage()->CreateFolder(aBuf, IStorage::TYPE_SAVE); - FilelistPopulate(IStorage::TYPE_SAVE); - if(m_FilesSelectedIndex >= 0 && !m_FileList[m_FilesSelectedIndex].m_IsDir) - str_copy(m_aFileDialogFileName, m_FileList[m_FilesSelectedIndex].m_aFilename, sizeof(m_aFileDialogFileName)); - else - m_aFileDialogFileName[0] = 0; + if(Storage()->CreateFolder(aBuf, IStorage::TYPE_SAVE)) + { + FilelistPopulate(IStorage::TYPE_SAVE); + if(m_FilesSelectedIndex >= 0 && !m_FileList[m_FilesSelectedIndex].m_IsDir) + str_copy(m_aFileDialogFileName, m_FileList[m_FilesSelectedIndex].m_aFilename, sizeof(m_aFileDialogFileName)); + else + m_aFileDialogFileName[0] = 0; + } } } } |