From 0b132ace003ce2773d313f08abcde77ba8b0588d Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 20 Mar 2018 07:24:08 -0400 Subject: [PATCH] ... --- coders/xpm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/coders/xpm.c b/coders/xpm.c index d710287f7..570cc3dbc 100644 --- a/coders/xpm.c +++ b/coders/xpm.c @@ -779,7 +779,7 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info, (void) WriteBlobString(image,"/* XPM */\n"); GetPathComponent(picon->filename,BasePath,basename); (void) FormatLocaleString(buffer,MagickPathExtent, - "static char *%s[] = {\n",basename); + "static char *%.1024s[] = {\n",basename); (void) WriteBlobString(image,buffer); (void) WriteBlobString(image,"/* columns rows colors chars-per-pixel */\n"); (void) FormatLocaleString(buffer,MagickPathExtent, @@ -813,8 +813,8 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info, symbol[j]=Cixel[k]; } symbol[j]='\0'; - (void) FormatLocaleString(buffer,MagickPathExtent,"\"%s c %s\",\n", - symbol,name); + (void) FormatLocaleString(buffer,MagickPathExtent, + "\"%.1024s c %.1024s\",\n",symbol,name); (void) WriteBlobString(image,buffer); } /* @@ -841,7 +841,7 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info, (void) WriteBlobString(image,buffer); p+=GetPixelChannels(picon); } - (void) FormatLocaleString(buffer,MagickPathExtent,"\"%s\n", + (void) FormatLocaleString(buffer,MagickPathExtent,"\"%.1024s\n", y == (ssize_t) (picon->rows-1) ? "" : ","); (void) WriteBlobString(image,buffer); status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, @@ -1006,7 +1006,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image, GetPathComponent(image->filename,BasePath,basename); if (isalnum((int) ((unsigned char) *basename)) == 0) { - (void) FormatLocaleString(buffer,MagickPathExtent,"xpm_%s",basename); + (void) FormatLocaleString(buffer,MagickPathExtent,"xpm_%.1024s",basename); (void) CopyMagickString(basename,buffer,MagickPathExtent); } if (isalpha((int) ((unsigned char) basename[0])) == 0) @@ -1015,7 +1015,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image, if (isalnum((int) ((unsigned char) basename[i])) == 0) basename[i]='_'; (void) FormatLocaleString(buffer,MagickPathExtent, - "static char *%s[] = {\n",basename); + "static char *%.1024s[] = {\n",basename); (void) WriteBlobString(image,buffer); (void) WriteBlobString(image,"/* columns rows colors chars-per-pixel */\n"); (void) FormatLocaleString(buffer,MagickPathExtent, @@ -1046,8 +1046,8 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image, symbol[j]=Cixel[k]; } symbol[j]='\0'; - (void) FormatLocaleString(buffer,MagickPathExtent,"\"%s c %s\",\n",symbol, - name); + (void) FormatLocaleString(buffer,MagickPathExtent, + "\"%.1024s c %.1024s\",\n",symbol,name); (void) WriteBlobString(image,buffer); } /* @@ -1074,7 +1074,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image, (void) WriteBlobString(image,buffer); p+=GetPixelChannels(image); } - (void) FormatLocaleString(buffer,MagickPathExtent,"\"%s\n", + (void) FormatLocaleString(buffer,MagickPathExtent,"\"%.1024s\n", (y == (ssize_t) (image->rows-1) ? "" : ",")); (void) WriteBlobString(image,buffer); if (image->previous == (Image *) NULL) -- 2.40.0