map=MapBlob(file,ReadMode,0,*length);
if (map != (unsigned char *) NULL)
{
- (void) CopyMagickMemory(blob,map,*length);
+ (void) memcpy(blob,map,*length);
(void) UnmapBlob(map,*length);
}
else
return(0);
}
q=image->blob->data+image->blob->offset;
- (void) CopyMagickMemory(q,data,length);
+ (void) memcpy(q,data,length);
image->blob->offset+=length;
if (image->blob->offset >= (MagickOffsetType) image->blob->length)
image->blob->length=(size_t) image->blob->offset;
ResourceLimitFatalError,"MemoryAllocationFailed","`%s'","");
return((Image *) NULL);
}
- (void) CopyMagickMemory(ping_info->blob,blob,length);
+ (void) memcpy(ping_info->blob,blob,length);
ping_info->length=length;
ping_info->ping=MagickTrue;
image=ReadStream(ping_info,&PingStream,exception);
image->blob->offset+=count;
if (count != (ssize_t) length)
image->blob->eof=MagickTrue;
- (void) CopyMagickMemory(q,p,(size_t) count);
+ (void) memcpy(q,p,(size_t) count);
break;
}
}
}
}
q=image->blob->data+image->blob->offset;
- (void) CopyMagickMemory(q,p,length);
+ (void) memcpy(q,p,length);
image->blob->offset+=length;
if (image->blob->offset >= (MagickOffsetType) image->blob->length)
image->blob->length=(size_t) image->blob->offset;
length=0;
if (source != (char *) NULL)
length+=strlen(source);
- destination=(char *) NULL;
- if (~length >= MaxTextExtent)
- destination=(char *) AcquireQuantumMemory(length+MaxTextExtent,
- sizeof(*destination));
+ if (~length < MaxTextExtent)
+ ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString");
+ destination=(char *) AcquireQuantumMemory(length+MaxTextExtent,
+ sizeof(*destination));
if (destination == (char *) NULL)
ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString");
*destination='\0';
if (source != (char *) NULL)
- {
- (void) CopyMagickMemory(destination,source,length*sizeof(*destination));
- destination[length]='\0';
- }
+ (void) memcpy(destination,source,length*sizeof(*destination));
+ destination[length]='\0';
return(destination);
}
\f
sizeof(*destination));
if (*destination == (char *) NULL)
ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString");
- (void) CopyMagickMemory(*destination,source,length*sizeof(*destination));
+ if (length != 0)
+ (void) memcpy(*destination,source,length*sizeof(*destination));
(*destination)[length]='\0';
return(*destination);
}
assert(string_info->signature == MagickSignature);
clone_info=AcquireStringInfo(string_info->length);
if (string_info->length != 0)
- (void) CopyMagickMemory(clone_info->datum,string_info->datum,
- string_info->length+1);
+ (void) memcpy(clone_info->datum,string_info->datum,string_info->length+1);
return(clone_info);
}
\f
const char *source)
{
size_t
+ destination_length,
length,
source_length;
*destination=AcquireString(source);
return(MagickTrue);
}
- length=strlen(*destination);
+ destination_length=strlen(*destination);
source_length=strlen(source);
+ length=destination_length;
if (~length < source_length)
ThrowFatalException(ResourceLimitFatalError,"UnableToConcatenateString");
length+=source_length;
sizeof(*destination));
if (*destination == (char *) NULL)
ThrowFatalException(ResourceLimitFatalError,"UnableToConcatenateString");
- (void) ConcatenateMagickString(*destination,source,(length+1)*
- sizeof(*destination));
+ if (source_length != 0)
+ (void) memcpy((*destination)+destination_length,source,source_length);
+ (*destination)[length]='\0';
return(MagickTrue);
}
\f
if (~length < source->length)
ThrowFatalException(ResourceLimitFatalError,"UnableToConcatenateString");
SetStringInfoLength(string_info,length+source->length);
- (void) CopyMagickMemory(string_info->datum+length,source->datum,
- source->length);
+ (void) memcpy(string_info->datum+length,source->datum,source->length);
}
\f
/*
map=MapBlob(file,ReadMode,0,length);
if (map != (void *) NULL)
{
- (void) CopyMagickMemory(string,map,length);
+ (void) memcpy(string,map,length);
(void) UnmapBlob(map,length);
}
else
ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString");
*destination='\0';
if (source != (char *) NULL)
- {
- (void) CopyMagickMemory(destination,source,length*sizeof(*destination));
- destination[length]='\0';
- }
+ (void) memcpy(destination,source,length*sizeof(*destination));
+ destination[length]='\0';
return(destination);
}
\f
if (string_info->length == 0)
return;
(void) ResetMagickMemory(string_info->datum,0,string_info->length);
- (void) CopyMagickMemory(string_info->datum,source->datum,MagickMin(
- string_info->length,source->length));
+ (void) memcpy(string_info->datum,source->datum,MagickMin(string_info->length,
+ source->length));
}
\f
/*
assert(string_info != (StringInfo *) NULL);
assert(string_info->signature == MagickSignature);
if (string_info->length != 0)
- (void) CopyMagickMemory(string_info->datum,source,string_info->length);
+ (void) memcpy(string_info->datum,source,string_info->length);
}
\f
/*
return((StringInfo *) NULL);
split_info=AcquireStringInfo(offset);
SetStringInfo(split_info,string_info);
- (void) CopyMagickMemory(string_info->datum,string_info->datum+offset,
+ (void) memcpy(string_info->datum,string_info->datum+offset,
string_info->length-offset+MaxTextExtent);
SetStringInfoLength(string_info,string_info->length-offset);
return(split_info);
string=(char *) AcquireQuantumMemory(length+MaxTextExtent,sizeof(*string));
if (string == (char *) NULL)
return((char *) NULL);
- (void) CopyMagickMemory(string,(char *) string_info->datum,length*
- sizeof(*string));
+ (void) memcpy(string,(char *) string_info->datum,length*sizeof(*string));
string[length]='\0';
return(string);
}
ThrowFatalException(ResourceLimitFatalError,
"UnableToConvertStringToARGV");
}
- (void) CopyMagickMemory(argv[i],p,(size_t) (q-p));
+ (void) memcpy(argv[i],p,(size_t) (q-p));
argv[i][q-p]='\0';
p=q;
while ((isspace((int) ((unsigned char) *p)) == 0) && (*p != '\0'))
sizeof(*textlist));
if (textlist[i] == (char *) NULL)
ThrowFatalException(ResourceLimitFatalError,"UnableToConvertText");
- (void) CopyMagickMemory(textlist[i],p,(size_t) (q-p));
+ (void) memcpy(textlist[i],p,(size_t) (q-p));
textlist[i][q-p]='\0';
if (*q == '\r')
q++;
if (q > p)
if ((*q == '\'') || (*q == '"'))
q--;
- (void) CopyMagickMemory(message,p,(size_t) (q-p+1));
+ (void) memcpy(message,p,(size_t) (q-p+1));
message[q-p+1]='\0';
for (p=message; *p != '\0'; p++)
if (*p == '\n')
Replace string.
*/
if (search_extent != replace_extent)
- (void) CopyMagickMemory(p+replace_extent,p+search_extent,
- strlen(p+search_extent)+1);
- (void) CopyMagickMemory(p,replace,replace_extent);
+ (void) memcpy(p+replace_extent,p+search_extent,strlen(p+search_extent)+1);
+ (void) memcpy(p,replace,replace_extent);
p+=replace_extent-1;
}
return(status);