Re: linux-ipsec: apps/utils/libs that parse IP/netbits > > > - The diagnostics could easily be made a little more useful. If the
> > > results were of type const char *, success could be indicated by NULL
> > > and failure by a message...
>
> Hmmm, how does the memory get released? Do we copy it immediately
Much the simplest thing is to say that it's a string literal and hence need
not receive any special attention from the caller. This does limit how
precise the error message can be, but the point is just to be a little more
specific than "something went wrong".
> I'm not crazy about this whole idea as it is somewhat counter-intuitive...
I think with Hugh's suggestion -- always put the result in a variable named
something like "error" or "oops" -- it works out okay. I've been trying it
out internally, and it seems to be workable and reasonably readable. The
more specific error reporting has already been useful.
Henry Spencer
henry@spsystems.net
(henry@zoo.toronto.edu)
Received on Mon Jul 20 13:36:39 1998
This archive was generated by hypermail 2.1.8
: Wed Aug 23 2006 - 12:59:24 EDT
|