From 8c4beb987c07e30db87db0fac6580268b0729fba Mon Sep 17 00:00:00 2001 From: def Date: Thu, 12 Nov 2020 14:53:38 +0100 Subject: [PATCH] DemoRecorder: Only remove existing filenames As noticed by Jupstar --- src/engine/client/client.cpp | 3 ++- src/engine/shared/storage.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index d11acdf86..b3dd8be5d 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -3873,7 +3873,8 @@ void CClient::DemoRecorder_Stop(int Recorder, bool RemoveFile) if(RemoveFile) { const char *pFilename = (&m_DemoRecorder[Recorder])->GetCurrentFilename(); - Storage()->RemoveFile(pFilename, IStorage::TYPE_SAVE); + if(pFilename[0] != '\0') + Storage()->RemoveFile(pFilename, IStorage::TYPE_SAVE); } } diff --git a/src/engine/shared/storage.cpp b/src/engine/shared/storage.cpp index 27ddba4fe..3f2ca2486 100644 --- a/src/engine/shared/storage.cpp +++ b/src/engine/shared/storage.cpp @@ -481,7 +481,7 @@ public: bool Success = !fs_remove(aBuffer); if(!Success) - dbg_msg("storage", "failed to remove: %s", aBuffer); + dbg_msg("storage", "failed to remove binary: %s", aBuffer); return Success; }