Skip to content

Commit

Permalink
optimize performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jun 8, 2022
1 parent 24d66bd commit 975e715
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion magick/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ MagickPrivate MagickBooleanType ShredMagickMemory(void *memory,
/*
Overwrite the memory buffer with random data.
*/
quantum=(size_t) MagickMin(length,MagickMaxBufferExtent);
quantum=(size_t) MagickMin(length,MagickMinBufferExtent);
random_info=AcquireRandomInfo();
key=GetRandomKey(random_info,quantum);
for (i=0; i < passes; i++)
Expand Down
4 changes: 2 additions & 2 deletions magick/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,9 +1901,9 @@ MagickPrivate MagickBooleanType ShredFile(const char *path)
/*
Shred the file.
*/
quantum=(size_t) MagickMaxBufferExtent;
quantum=(size_t) MagickMinBufferExtent;
if ((fstat(file,&file_stats) == 0) && (file_stats.st_size > 0))
quantum=(size_t) MagickMin(file_stats.st_size,MagickMaxBufferExtent);
quantum=(size_t) MagickMin(file_stats.st_size,MagickMinBufferExtent);
length=(MagickSizeType) file_stats.st_size;
random_info=AcquireRandomInfo();
key=GetRandomKey(random_info,quantum);
Expand Down

0 comments on commit 975e715

Please sign in to comment.