From: Cristy Date: Wed, 28 Feb 2018 01:43:08 +0000 (-0500) Subject: https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=33455 X-Git-Tag: 7.0.7-25~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82a97ac8ec50712248db73b6731d80ff7832894c;p=imagemagick https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=33455 --- diff --git a/MagickCore/image.c b/MagickCore/image.c index edc527ad0..97d8e1794 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -1639,6 +1639,7 @@ MagickExport size_t InterpretImageFilename(const ImageInfo *image_info, *p; size_t + field_width, length; canonical=MagickFalse; @@ -1652,14 +1653,9 @@ MagickExport size_t InterpretImageFilename(const ImageInfo *image_info, p=q+1; continue; } + field_width=0; if (*q == '0') - { - ssize_t - foo; - - foo=(ssize_t) strtol(q,&q,10); - (void) foo; - } + field_width=(ssize_t) strtol(q,&q,10); switch (*q) { case 'd': @@ -1671,6 +1667,7 @@ MagickExport size_t InterpretImageFilename(const ImageInfo *image_info, *q='\0'; (void) FormatLocaleString(filename+(p-format),(size_t) (MagickPathExtent-(p-format)),p,value); + length+=(4-field_width); *q=c; (void) ConcatenateMagickString(filename,q,MagickPathExtent); canonical=MagickTrue;