From cea3911ccae307cb58b05cb126ad20bca010190a Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 9 Feb 2018 20:49:09 -0500 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/966 --- MagickCore/display.c | 4 ++-- MagickCore/identify.c | 2 +- MagickCore/montage.c | 2 +- coders/html.c | 7 ++++--- coders/json.c | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/MagickCore/display.c b/MagickCore/display.c index 2646e89af..bca794191 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -13149,7 +13149,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info, p=image->directory; for (i=tile; (i != 0) && (*p != '\0'); ) { - if (*p == '\n') + if (*p == '\377') i--; p++; } @@ -13259,7 +13259,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info, *image_view; q=p; - while ((*q != '\n') && (*q != '\0')) + while ((*q != '\377') && (*q != '\0')) q++; (void) CopyMagickString(filename,p,(size_t) (q-p+1)); p=q; diff --git a/MagickCore/identify.c b/MagickCore/identify.c index 096c15cba..45179dc77 100644 --- a/MagickCore/identify.c +++ b/MagickCore/identify.c @@ -1233,7 +1233,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, for (d=image->directory; *d != '\0'; d++) { q=d; - while ((*q != '\n') && (*q != '\0') && + while ((*q != '\377') && (*q != '\0') && ((size_t) (q-d) < sizeof(image_info->filename))) q++; (void) CopyMagickString(image_info->filename,d,(size_t) (q-d+1)); diff --git a/MagickCore/montage.c b/MagickCore/montage.c index 97cb31514..7c750a3c8 100644 --- a/MagickCore/montage.c +++ b/MagickCore/montage.c @@ -663,7 +663,7 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info, { (void) ConcatenateMagickString(montage->directory, image_list[tile]->filename,extent); - (void) ConcatenateMagickString(montage->directory,"\n",extent); + (void) ConcatenateMagickString(montage->directory,"\377",extent); tile++; } progress_monitor=SetImageProgressMonitor(montage,(MagickProgressMonitor) diff --git a/coders/html.c b/coders/html.c index 53a9a0ebe..2ed89f909 100644 --- a/coders/html.c +++ b/coders/html.c @@ -334,7 +334,8 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info, (void) FormatLocaleString(buffer,MagickPathExtent, "\n",mapname,mapname); (void) WriteBlobString(image,buffer); - (void) FormatLocaleString(buffer,MagickPathExtent," directory == (char *) NULL) { @@ -346,7 +347,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info, } else for (p=image->directory; *p != '\0'; p++) - if (*p != '\n') + if (*p != '\377') (void) WriteBlobByte(image,(unsigned char) *p); else { @@ -421,7 +422,7 @@ static MagickBooleanType WriteHTMLImage(const ImageInfo *image_info, } else for (p=image->directory; *p != '\0'; p++) - if (*p != '\n') + if (*p != '\377') (void) WriteBlobByte(image,(unsigned char) *p); else { diff --git a/coders/json.c b/coders/json.c index eda12064f..6ee4b29cc 100644 --- a/coders/json.c +++ b/coders/json.c @@ -1502,7 +1502,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, while (*p != '\0') { q=p; - while ((*q != '\n') && (*q != '\0')) + while ((*q != '\377') && (*q != '\0')) q++; (void) CopyMagickString(image_info->filename,p,(size_t) (q-p+1)); p=q+1; -- 2.40.0