[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Patch to anna for choosing retriever



tis 2002-08-27 klockan 21.18 skrev Tollef Fog Heen:
> * Martin Sjögren 
> 
> | I "volunteered" (:p) to hack in some support in anna for choosing which
> | retriever to use. Seeing as my sister too is called Anna, I felt
> | qualified enough for this ;) Attached is a patch. Seeing as I don't
> | trust myself with proofreading and testing my own code, I'd be happy if
> | someone could look it over.
> 
> Looks ok, as you write: could use some error handling.

Yes, but I'm not sure how to go about it. Return NULL and let the caller
deal with it? There's a general lack of error handling elsewhere too.

"If a function be advertised to return an error code in the event of
difficulties, thou shalt check for that code, yea, even though the
checks triple the size of thy code and produce aches in thy typing
fingers, for if thou thinkest "it cannot happen to me," the gods shall
surely punish thee for thy arrogance."

comes to mind ;)

> Also, I severly dislike hard coding string lengths, so I changed that
> into strlens.

Works for me. As I said, I went by a precedent in other places. I'm of a
mind to change the str + N things in the package file parsing to using
strchr(str, ' ')+1 instead though, that would get rid of the problem.


Regards,
Martin

Attachment: signature.asc
Description: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signerad meddelandedel


Reply to: