From d2ce3601d1805fa4da0524fdfa728aed9c1d05ec Mon Sep 17 00:00:00 2001 From: cristy Date: Thu, 18 Apr 2013 19:30:20 +0000 Subject: [PATCH] --- MagickCore/utility.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/MagickCore/utility.c b/MagickCore/utility.c index 3114b881a..ed40ae9d7 100644 --- a/MagickCore/utility.c +++ b/MagickCore/utility.c @@ -1804,8 +1804,7 @@ MagickPrivate MagickBooleanType ShredFile(const char *path) if ((path == (const char *) NULL) || (*path == '\0')) return(MagickFalse); exception=AcquireExceptionInfo(); - passes=(char *) GetImageRegistry(StringRegistryType,"shred-passes", - exception); + passes=(char *) GetImageRegistry(StringRegistryType,"shred-passes",exception); exception=DestroyExceptionInfo(exception); if (passes == (char *) NULL) passes=GetEnvironmentValue("MAGICK_SHRED_PASSES"); @@ -1821,7 +1820,13 @@ MagickPrivate MagickBooleanType ShredFile(const char *path) } file=open_utf8(path,O_WRONLY | O_EXCL | O_BINARY,S_MODE); if (file == -1) - return(MagickFalse); + { + /* + Don't shred the file, just remove it. + */ + status=remove_utf8(path); + return(MagickFalse); + } /* Shred the file. */ @@ -1870,7 +1875,7 @@ MagickPrivate MagickBooleanType ShredFile(const char *path) status=remove_utf8(path); if (status == -1) return(MagickFalse); - return(i < StringToInteger(passes) ? MagickFalse : MagickTrue); + return(i < (ssize_t) StringToInteger(passes) ? MagickFalse : MagickTrue); } /* -- 2.40.0