% MagickCore Utility Methods %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% January 1993 %
% %
% %
-% Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
%
*/
-static inline size_t MagickMin(const size_t x,const size_t y)
+static inline MagickSizeType MagickMin(const MagickSizeType x,
+ const MagickSizeType y)
{
if (x < y)
return(x);
}
quantum=(size_t) MagickMaxBufferExtent;
if ((fstat(source_file,&attributes) == 0) && (attributes.st_size != 0))
- quantum=MagickMin((size_t) attributes.st_size,MagickMaxBufferExtent);
+ quantum=(size_t) MagickMin((size_t) attributes.st_size,
+ MagickMaxBufferExtent);
buffer=(unsigned char *) AcquireQuantumMemory(quantum,sizeof(*buffer));
if (buffer == (unsigned char *) NULL)
{
*path='\0';
*filename='\0';
*subimage='\0';
+ number_files=0;
vector[count++]=ConstantString(option);
destroy=MagickTrue;
parameters=ParseCommandOption(MagickCommandOptions,MagickFalse,option);
Generate file list from file list (e.g. @filelist.txt).
*/
exception=AcquireExceptionInfo();
- files=FileToString(option+1,~0,exception);
+ files=FileToString(option+1,~0UL,exception);
exception=DestroyExceptionInfo(exception);
if (files == (char *) NULL)
continue;
if (*path != '\0')
(void) ConcatenateMagickString(filename,DirectorySeparator,
MaxTextExtent);
- (void) ConcatenateMagickString(filename,filelist[j],MaxTextExtent);
+ if (filelist[j] != (char *) NULL)
+ (void) ConcatenateMagickString(filename,filelist[j],MaxTextExtent);
filelist[j]=DestroyString(filelist[j]);
if (strlen(filename) >= (MaxTextExtent-1))
ThrowFatalException(OptionFatalError,"FilenameTruncated");
program_name=(char *) RelinquishMagickMemory(program_name);
execution_path=(char *) RelinquishMagickMemory(execution_path);
}
+#endif
+#if defined(__OpenBSD__)
+ {
+ extern char
+ *__progname;
+
+ (void) CopyMagickString(path,__progname,extent);
+ }
#endif
return(IsPathAccessible(path));
}
char
*passes;
- ExceptionInfo
- *exception;
-
int
file,
status;
if ((path == (const char *) NULL) || (*path == '\0'))
return(MagickFalse);
- exception=AcquireExceptionInfo();
- passes=(char *) GetImageRegistry(StringRegistryType,"shred-passes",exception);
- exception=DestroyExceptionInfo(exception);
- if (passes == (char *) NULL)
- passes=GetEnvironmentValue("MAGICK_SHRED_PASSES");
+ passes=GetEnvironmentValue("MAGICK_SHRED_PASSES");
if (passes == (char *) NULL)
{
/*
}
}
random_info=DestroyRandomInfo(random_info);
- if (j < length)
+ if (j < (MagickOffsetType) length)
break;
}
status=close(file);