Commit 138ffea02 for imagemagick.org
commit 138ffea02dd178c06875a861e6618be42e17a19b
Author: Cristy <urban-warrior@imagemagick.org>
Date: Fri Nov 6 19:31:30 2026 -0500
slight optimization
diff --git a/MagickCore/string.c b/MagickCore/string.c
index f0406a830..9fe6a6d6f 100644
--- a/MagickCore/string.c
+++ b/MagickCore/string.c
@@ -465,7 +465,7 @@ MagickExport MagickBooleanType ConcatenateString(
source_length;
assert(destination != (char **) NULL);
- if (source == (const char *) NULL)
+ if ((source == (const char *) NULL) || (*source == '\0'))
return(MagickTrue);
if (*destination == (char *) NULL)
{
@@ -484,8 +484,7 @@ MagickExport MagickBooleanType ConcatenateString(
OverAllocateMemory(length+MagickPathExtent),sizeof(**destination));
if (*destination == (char *) NULL)
ThrowFatalException(ResourceLimitFatalError,"UnableToConcatenateString");
- if (source_length != 0)
- (void) memcpy((*destination)+destination_length,source,source_length);
+ (void) memcpy((*destination)+destination_length,source,source_length);
(*destination)[length]='\0';
return(MagickTrue);
}