Commit cfd763ae5 for imagemagick.org
commit cfd763ae526dec71f9a776b03378485b482d6349
Author: Cristy <urban-warrior@imagemagick.org>
Date: Mon Jun 15 09:02:20 2026 -0400
remove legacy snprintf() dead code
diff --git a/MagickCore/exception.c b/MagickCore/exception.c
index 20018b447..e622dca16 100644
--- a/MagickCore/exception.c
+++ b/MagickCore/exception.c
@@ -1122,11 +1122,7 @@ MagickExport MagickBooleanType ThrowMagickExceptionList(
(void) CopyMagickString(reason,locale,MagickPathExtent);
(void) ConcatenateMagickString(reason," ",MagickPathExtent);
length=strlen(reason);
-#if defined(MAGICKCORE_HAVE_VSNPRINTF)
n=vsnprintf(reason+length,MagickPathExtent-length,format,operands);
-#else
- n=vsprintf(reason+length,format,operands);
-#endif
if (n < 0)
reason[MagickPathExtent-1]='\0';
status=LogMagickEvent(ExceptionEvent,module,function,line,"%s",reason);
diff --git a/MagickCore/locale.c b/MagickCore/locale.c
index cf2c0f8ce..be7c812cf 100644
--- a/MagickCore/locale.c
+++ b/MagickCore/locale.c
@@ -453,8 +453,7 @@ MagickPrivate ssize_t FormatLocaleStringList(char *magick_restrict string,
n=(ssize_t) vsnprintf_l(string,length,locale,format,operands);
#endif
}
-#elif defined(MAGICKCORE_HAVE_VSNPRINTF)
-#if defined(MAGICKCORE_LOCALE_SUPPORT) && defined(MAGICKCORE_HAVE_USELOCALE)
+#elif defined(MAGICKCORE_LOCALE_SUPPORT) && defined(MAGICKCORE_HAVE_USELOCALE)
{
locale_t
locale,
@@ -472,9 +471,6 @@ MagickPrivate ssize_t FormatLocaleStringList(char *magick_restrict string,
}
#else
n=(ssize_t) vsnprintf(string,length,format,operands);
-#endif
-#else
- n=(ssize_t) vsprintf(string,format,operands);
#endif
if (n < 0)
string[length-1]='\0';
diff --git a/MagickCore/log.c b/MagickCore/log.c
index bf0e8b69f..df9e6922b 100644
--- a/MagickCore/log.c
+++ b/MagickCore/log.c
@@ -1588,11 +1588,7 @@ MagickExport MagickBooleanType LogMagickEventList(const LogEventType type,
return(MagickTrue);
}
domain=CommandOptionToMnemonic(MagickLogEventOptions,type);
-#if defined(MAGICKCORE_HAVE_VSNPRINTF)
n=vsnprintf(event,MagickPathExtent,format,operands);
-#else
- n=vsprintf(event,format,operands);
-#endif
if (n < 0)
event[MagickPathExtent-1]='\0';
text=TranslateEvent(module,function,line,domain,event);
diff --git a/coders/msl.c b/coders/msl.c
index 340fd2e02..ee7a494ce 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -7308,11 +7308,7 @@ static void MSLWarning(void *context,const char *format,...)
parser=(xmlParserCtxtPtr) context;
msl_info=(MSLInfo *) parser->_private;
(void) msl_info;
-#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
- (void) vsprintf(reason,format,operands);
-#else
(void) vsnprintf(reason,MagickPathExtent,format,operands);
-#endif
message=GetExceptionMessage(errno);
ThrowMSLException(CoderError,reason,message);
message=DestroyString(message);
@@ -7346,11 +7342,7 @@ static void MSLError(void *context,const char *format,...)
parser=(xmlParserCtxtPtr) context;
msl_info=(MSLInfo *) parser->_private;
(void) msl_info;
-#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
- (void) vsprintf(reason,format,operands);
-#else
(void) vsnprintf(reason,MagickPathExtent,format,operands);
-#endif
ThrowMSLException(DelegateFatalError,reason,"SAX error");
va_end(operands);
xmlStopParser(parser);
diff --git a/coders/svg.c b/coders/svg.c
index ede9231d3..c7f39f52d 100644
--- a/coders/svg.c
+++ b/coders/svg.c
@@ -3046,11 +3046,7 @@ static void SVGWarning(void *context,const char *format,...)
}
(void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.warning: ");
(void) LogMagickEvent(CoderEvent,GetMagickModule(),format,operands);
-#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
- (void) vsprintf(reason,format,operands);
-#else
(void) vsnprintf(reason,MagickPathExtent,format,operands);
-#endif
message=GetExceptionMessage(errno);
(void) ThrowMagickException(svg_info->exception,GetMagickModule(),
DelegateWarning,reason,"`%s`",message);
@@ -3087,11 +3083,7 @@ static void SVGError(void *context,const char *format,...)
}
(void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.error: ");
(void) LogMagickEvent(CoderEvent,GetMagickModule(),format,operands);
-#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
- (void) vsprintf(reason,format,operands);
-#else
(void) vsnprintf(reason,MagickPathExtent,format,operands);
-#endif
message=GetExceptionMessage(errno);
(void) ThrowMagickException(svg_info->exception,GetMagickModule(),CoderError,
reason,"`%s`",message);
diff --git a/coders/tiff.c b/coders/tiff.c
index fcaa432a6..cf9897e22 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -559,11 +559,7 @@ static void TIFFErrors(const char *module,const char *format,va_list error)
ExceptionInfo
*exception;
-#if defined(MAGICKCORE_HAVE_VSNPRINTF)
(void) vsnprintf(message,MagickPathExtent-2,format,error);
-#else
- (void) vsprintf(message,format,error);
-#endif
message[MagickPathExtent-2]='\0';
(void) ConcatenateMagickString(message,".",MagickPathExtent);
exception=(ExceptionInfo *) GetMagickThreadValue(tiff_exception);
@@ -912,11 +908,7 @@ static void TIFFWarnings(const char *module,const char *format,va_list warning)
ExceptionInfo
*exception;
-#if defined(MAGICKCORE_HAVE_VSNPRINTF)
(void) vsnprintf(message,MagickPathExtent-2,format,warning);
-#else
- (void) vsprintf(message,format,warning);
-#endif
message[MagickPathExtent-2]='\0';
(void) ConcatenateMagickString(message,".",MagickPathExtent);
exception=(ExceptionInfo *) GetMagickThreadValue(tiff_exception);