Note image label.
*/
label=(char *) NULL;
- if (~summary_info.title.length >= MaxTextExtent)
+ if (~summary_info.title.length >= (MaxTextExtent-1))
label=(char *) AcquireQuantumMemory(summary_info.title.length+
MaxTextExtent,sizeof(*label));
if (label == (char *) NULL)
Note image comment.
*/
comments=(char *) NULL;
- if (~summary_info.comments.length >= MaxTextExtent)
+ if (~summary_info.comments.length >= (MaxTextExtent-1))
comments=(char *) AcquireQuantumMemory(summary_info.comments.length+
MaxTextExtent,sizeof(*comments));
if (comments == (char *) NULL)
summary_info.title_valid=MagickTrue;
length=strlen(label);
summary_info.title.length=length;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
summary_info.title.ptr=(unsigned char *) AcquireQuantumMemory(
length+MaxTextExtent,sizeof(*summary_info.title.ptr));
if (summary_info.title.ptr == (unsigned char *) NULL)
if (length <= 0)
return(MagickTrue);
comment=(char *) NULL;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
comment=(char *) AcquireQuantumMemory(length+MaxTextExtent,
sizeof(*comment));
if (comment == (char *) NULL)
else
{
msl_info->content=(char *) NULL;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
msl_info->content=(char *) AcquireQuantumMemory(length+MaxTextExtent,
sizeof(*msl_info->content));
if (msl_info->content != (char *) NULL)
*/
length=(size_t) tga_info.id_length;
comment=(char *) NULL;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
comment=(char *) AcquireQuantumMemory(length+MaxTextExtent,
sizeof(*comment));
if (comment == (char *) NULL)
}
*length=(size_t) MagickMin((MagickSizeType) offset,extent);
blob=(unsigned char *) NULL;
- if (~(*length) >= MaxTextExtent)
+ if (~(*length) >= (MaxTextExtent-1))
blob=(unsigned char *) AcquireQuantumMemory(*length+MaxTextExtent,
sizeof(*blob));
if (blob == (unsigned char *) NULL)
flags=NoValue;
if ((geometry == (char *) NULL) || (*geometry == '\0'))
return(flags);
- if (strlen(geometry) >= MaxTextExtent)
+ if (strlen(geometry) >= (MaxTextExtent-1))
return(flags);
(void) CopyMagickString(pedantic_geometry,geometry,MaxTextExtent);
for (p=pedantic_geometry; *p != '\0'; )
flags=NoValue;
if ((geometry == (char *) NULL) || (*geometry == '\0'))
return(flags);
- if (strlen(geometry) >= MaxTextExtent)
+ if (strlen(geometry) >= (MaxTextExtent-1))
return(flags);
(void) CopyMagickString(pedantic_geometry,geometry,MaxTextExtent);
for (p=pedantic_geometry; *p != '\0'; )
length=(size_t) (GetStringInfoDatum(profile)[i++] << 8);
length|=GetStringInfoDatum(profile)[i++];
attribute=(char *) NULL;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
attribute=(char *) AcquireQuantumMemory(length+
MaxTextExtent,sizeof(*attribute));
if (attribute != (char *) NULL)
assert(path != (const char *) NULL);
length=CopyMagickString(file_specification,path,MaxTextExtent);
- if (length >= MaxTextExtent)
+ if (length >= (MaxTextExtent-1))
return((DIR *) NULL);
length=ConcatenateMagickString(file_specification,DirectorySeparator,
MaxTextExtent);
- if (length >= MaxTextExtent)
+ if (length >= (MaxTextExtent-1))
return((DIR *) NULL);
entry=(DIR *) AcquireMagickMemory(sizeof(DIR));
if (entry != (DIR *) NULL)
if (entry->hSearch == INVALID_HANDLE_VALUE)
{
length=ConcatenateMagickString(file_specification,"\\*.*",MaxTextExtent);
- if (length >= MaxTextExtent)
+ if (length >= (MaxTextExtent-1))
{
entry=(DIR *) RelinquishMagickMemory(entry);
return((DIR *) NULL);
if ((count != 0) && ((size_t) count <= length))
{
resource=(char *) NULL;
- if (~(1UL*count) >= MaxTextExtent)
+ if (~(1UL*count) >= (MaxTextExtent-1))
resource=(char *) AcquireQuantumMemory((size_t) count+MaxTextExtent,
sizeof(*resource));
if (resource != (char *) NULL)
We have the resource of interest.
*/
attribute=(char *) NULL;
- if (~(1UL*count) >= MaxTextExtent)
+ if (~(1UL*count) >= (MaxTextExtent-1))
attribute=(char *) AcquireQuantumMemory((size_t) count+MaxTextExtent,
sizeof(*attribute));
if (attribute != (char *) NULL)
{ \
length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
format", ",arg); \
- if (length >= MaxTextExtent - 1) \
+ if (length >= (MaxTextExtent-1)) \
length=MaxTextExtent-1; \
p1+=size; \
} \
{ \
length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
format", ",arg1, arg2); \
- if (length >= MaxTextExtent - 1) \
+ if (length >= (MaxTextExtent-1)) \
length=MaxTextExtent-1; \
p1+=size; \
} \
if (string_info->length != 0)
{
string_info->datum=(unsigned char *) NULL;
- if (~string_info->length >= MaxTextExtent)
+ if (~string_info->length >= (MaxTextExtent-1))
string_info->datum=(unsigned char *) AcquireQuantumMemory(
string_info->length+MaxTextExtent,sizeof(*string_info->datum));
if (string_info->datum == (unsigned char *) NULL)
}
length=(size_t) offset;
string=(char *) NULL;
- if (~length > MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
string=(char *) AcquireQuantumMemory(length+MaxTextExtent,sizeof(*string));
if (string == (char *) NULL)
{
length++;
}
destination=(char *) NULL;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
destination=(char *) AcquireQuantumMemory(length+MaxTextExtent,
sizeof(*destination));
if (destination == (char *) NULL)
string=(char *) NULL;
length=string_info->length;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
string=(char *) AcquireQuantumMemory(length+MaxTextExtent,sizeof(*string));
if (string == (char *) NULL)
return((char *) NULL);
threshold_map=p;
while (((isspace((int) ((unsigned char) *p)) == 0) && (*p != ',')) &&
(*p != '\0')) {
- if ((p-threshold_map) >= MaxTextExtent)
+ if ((p-threshold_map) >= (MaxTextExtent-1))
break;
token[p-threshold_map] = *p;
p++;
(void) ConcatenateMagickString(path,subimage,MaxTextExtent);
(void) ConcatenateMagickString(path,"]",MaxTextExtent);
}
- if (strlen(path) >= MaxTextExtent)
+ if (strlen(path) >= (MaxTextExtent-1))
ThrowFatalException(OptionFatalError,"FilenameTruncated");
if (destroy != MagickFalse)
{
if ((status != Success) || (type != XA_STRING) || (format == 32) ||
(length == 0))
break;
- if ((Extent(reply_info.text)+length) >= MaxTextExtent)
+ if ((Extent(reply_info.text)+length) >= (MaxTextExtent-1))
(void) XBell(display,0);
else
{
if ((status != Success) || (type != XA_STRING) || (format == 32) ||
(length == 0))
break;
- if ((Extent(reply_info.text)+length) >= MaxTextExtent)
+ if ((Extent(reply_info.text)+length) >= (MaxTextExtent-1))
(void) XBell(display,0);
else
{
if ((status != Success) || (type != XA_STRING) || (format == 32) ||
(length == 0))
break;
- if ((Extent(reply_info.text)+length) >= MaxTextExtent)
+ if ((Extent(reply_info.text)+length) >= (MaxTextExtent-1))
(void) XBell(display,0);
else
{
if ((status != Success) || (type != XA_STRING) || (format == 32) ||
(length == 0))
break;
- if ((Extent(reply_info.text)+length) >= MaxTextExtent)
+ if ((Extent(reply_info.text)+length) >= (MaxTextExtent-1))
(void) XBell(display,0);
else
{
if ((status != Success) || (type != XA_STRING) || (format == 32) ||
(length == 0))
break;
- if ((Extent(reply_info.text)+length) >= MaxTextExtent)
+ if ((Extent(reply_info.text)+length) >= (MaxTextExtent-1))
(void) XBell(display,0);
else
{
*/
length=strlen(argv[i+1]);
token=(char *) NULL;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
token=(char *) AcquireQuantumMemory(length+MaxTextExtent,
sizeof(*token));
if (token == (char *) NULL)