From 208cacfadcc4d4773ae390e41289fe8a8a9dabce Mon Sep 17 00:00:00 2001 From: cristy Date: Fri, 3 Sep 2010 02:24:42 +0000 Subject: [PATCH] --- config/configure.xml | 2 +- magick/string.c | 30 +++++++++++++++++++----------- magick/version.h | 4 ++-- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/config/configure.xml b/config/configure.xml index 008964ba4..7a4c915b9 100644 --- a/config/configure.xml +++ b/config/configure.xml @@ -9,7 +9,7 @@ - + diff --git a/magick/string.c b/magick/string.c index b58bb0f69..dbf39f722 100644 --- a/magick/string.c +++ b/magick/string.c @@ -126,7 +126,10 @@ MagickExport char *AcquireString(const char *source) ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString"); *destination='\0'; if (source != (char *) NULL) - (void) CopyMagickString(destination,source,(length+1)*sizeof(*destination)); + { + (void) CopyMagickMemory(destination,source,length*sizeof(*destination)); + destination[length]='\0'; + } return(destination); } @@ -225,7 +228,8 @@ MagickExport char *CloneString(char **destination,const char *source) sizeof(*destination)); if (*destination == (char *) NULL) ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString"); - (void) CopyMagickString(*destination,source,(length+1)*sizeof(*destination)); + (void) CopyMagickMemory(*destination,source,length*sizeof(*destination)); + (*destination)[length]='\0'; return(*destination); } @@ -637,7 +641,10 @@ MagickExport char *ConstantString(const char *source) ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString"); *destination='\0'; if (source != (char *) NULL) - (void) CopyMagickString(destination,source,(length+1)*sizeof(*destination)); + { + (void) CopyMagickMemory(destination,source,length*sizeof(*destination)); + destination[length]='\0'; + } return(destination); } @@ -1851,9 +1858,11 @@ MagickExport char *StringInfoToString(const StringInfo *string_info) length=string_info->length; if (~length >= MaxTextExtent) string=(char *) AcquireQuantumMemory(length+MaxTextExtent,sizeof(*string)); - if (string != (char *) NULL) - (void) CopyMagickString(string,(char *) string_info->datum, - (length+1)*sizeof(*string)); + if (string == (char *) NULL) + return((char *) NULL); + (void) CopyMagickMemory(string,(char *) string_info->datum,length* + sizeof(*string)); + string[length]='\0'; return(string); } @@ -1953,7 +1962,8 @@ MagickExport char **StringToArgv(const char *text,int *argc) ThrowFatalException(ResourceLimitFatalError, "UnableToConvertStringToARGV"); } - (void) CopyMagickString(argv[i],p,(size_t) (q-p+1)); + (void) CopyMagickMemory(argv[i],p,(size_t) (q-p)); + argv[i][q-p]='\0'; p=q; while ((isspace((int) ((unsigned char) *p)) == 0) && (*p != '\0')) p++; @@ -2122,9 +2132,6 @@ MagickExport char *StringToken(const char *delimiters,char **string) % % A description of each parameter follows: % -% o list: Method StringToList returns the string list unless an error -% occurs, otherwise NULL. -% % o text: Specifies the string to segment into a list. % */ @@ -2174,7 +2181,8 @@ MagickExport char **StringToList(const char *text) sizeof(*textlist)); if (textlist[i] == (char *) NULL) ThrowFatalException(ResourceLimitFatalError,"UnableToConvertText"); - (void) CopyMagickString(textlist[i],p,(size_t) (q-p+1)); + (void) CopyMagickMemory(textlist[i],p,(size_t) (q-p)); + textlist[i][q-p]='\0'; if (*q == '\r') q++; p=q+1; diff --git a/magick/version.h b/magick/version.h index 1f906fbcd..9d60f1082 100644 --- a/magick/version.h +++ b/magick/version.h @@ -33,8 +33,8 @@ extern "C" { #define MagickLibAddendum "-0" #define MagickLibInterface 4 #define MagickLibMinInterface 4 -#define MagickReleaseDate "2010-08-31" -#define MagickChangeDate "20100823" +#define MagickReleaseDate "2010-09-02" +#define MagickChangeDate "20100902" #define MagickAuthoritativeURL "http://www.imagemagick.org" #define MagickFeatures "OpenMP " #define MagickHomeURL "file:///usr/local/share/doc/ImageMagick-6.6.4/index.html" -- 2.40.0