Skip to content

Commit

Permalink
set blob EOF flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Nov 4, 2022
1 parent dddd070 commit efcac58
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions magick/blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -4311,21 +4311,19 @@ MagickExport char *ReadBlobString(Image *image,char *string)
}
default:
{
for (i=0; i < (MagickPathExtent-2L); i++)
do
{
c=ReadBlobByte(image);
if (c == EOF)
{
if (i == 0)
return((char *) NULL);
blob_info->eof=MagickTrue;
break;
}
string[i]=c;
string[i++]=c;
if (c == '\n')
break;
}
string[++i]='\0';
i--;
} while (i < (MaxTextExtent-2));
string[i]='\0';
break;
}
}
Expand All @@ -4337,6 +4335,8 @@ MagickExport char *ReadBlobString(Image *image,char *string)
if (i >= 1)
if ((string[i-1] == '\r') || (string[i-1] == '\n'))
string[i-1]='\0';
if ((*string == '\0') && (blob_info->eof != MagickFalse))
return((char *) NULL);
return(string);
}

Expand Down

0 comments on commit efcac58

Please sign in to comment.