Re: patch: infoemail for err pages

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 5 Sep 2002 20:14:09 +0200

What Robert means is that your errorDump function should print the
output into a memBuf supplied by the caller, rather than create it's
own local memBuf and then return that one as a string.. This way the
caller can tell errorDump to put the result directly into the memBuf
where it should be.

More efficient, simpler and also correct coding.

Your memBufPrintf calls would be the same, the only difference is from
where the memBuf they print into comes.

Local static variables should be avoided where possible.. Yes I know I
am too lazy on that point if in a hurry, but in this case there is no
excuse as not using a local static is actually simpler than using
one..

Regards
Henrik

On Thursday 05 September 2002 19.13, PsychoTekk .de wrote:
> hi Robert,
>
> today i tried to do these changes but i still have problems:
> > I suggest you change the prototype of errorDump to
> >
> > static int
> > errorDump(ErrorState * err, memBuf *mb);
>
> gives me errors that always have to do with declarations
>
> > Then eliminate the locally scoped mb from errorDump, along with
> > the
>
> can you give me an example?
> there is one memBuffPrintf call that gives me an error
> because there is just one parameter left after removing mb
>
> > memBufReset at the top,
> > and everything from if (!p){p=mb.buf} to the end of the function.
>
> if i remove these lines i suppose i have to change any
> "p = blah" to "memBufPrintf()" calls ?
>
> > Then inoke errorDump as:
> > errorDump (err, &mb);
>
> thanks,
> Clemens
Received on Thu Sep 05 2002 - 12:59:00 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:16:27 MST