From d2579c07022af9f85ae6e2041c4bf39c951654b9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Jun 2016 11:24:50 +0100 Subject: [PATCH] Added handling of error value --- src/osgPlugins/zip/unzip.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/zip/unzip.cpp b/src/osgPlugins/zip/unzip.cpp index 3fb682b33..4825cfe3f 100644 --- a/src/osgPlugins/zip/unzip.cpp +++ b/src/osgPlugins/zip/unzip.cpp @@ -4188,7 +4188,14 @@ void EnsureDirectory(const TCHAR *rootdir, const TCHAR *dir) size_t len=_tcslen(rd); if (len>0 && (rd[len-1]=='/' || rd[len-1]=='\\')) rd[len-1]=0; #ifdef ZIP_STD - if (!FileExists(rd)) lumkdir(rd); + if (!FileExists(rd)) + { + if (lumkdir(rd)<0) + { + // mkdir failed + return; + } + } #else if (!FileExists(rd)) CreateDirectory(rd,0); #endif