Quoting Thorsten Haude <[EMAIL PROTECTED]>:

> Hi,
>
> * Thorsten Haude wrote (2008-01-06 01:40):
> >/* Allocate a new string buffer of length chars */
> >char *AllocString(int length)
> >{
> >    char *mem;
> >
> >    mem = XtMalloc(length + sizeof(char *) + 1);
> >    *((char **)mem) = AllocatedStrings;
> >    AllocatedStrings = mem;
> >#ifdef TRACK_GARBAGE_LEAKS
> >    ++numAllocatedStrings;
> >#endif
> >    return mem + sizeof(char *) + 1;
> >}
> >
> >- Also, it returns (mem + sizeof(char *) + 1), which is (char* +
> >  size_t + int). What is this supposed to bring about?
>
> A bunch of function test whether AllocString's return value is True or
> False. This happens if  XtMalloc() returns -(sizeof(char *) + 1).

Good point! But then, as you pointed out not long ago, XtMalloc failure in
nedit results in exit().

Tony

-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to