> Date: Sat, 19 Apr 2008 09:31:09 +0200 > From: [EMAIL PROTECTED] > > > > Well, a check like: > > pdf_list_create (foo, bar, baz, list) > ... > if (list == NULL) then error PDF_EBADDATA; > ... > > would protect the function for a single case of invalid pointer. But > as I mentioned early in C there is not a way (AFAIK) to determine if a > pointer is valid or invalid. So you are covering the case list == NULL > but not list == 24 (that is likely to be an invalid address) neither > list == 25 or list == 1.
I agree, but my philosophy is, if you can test at least for one invalid case, just do it. :-) greetings, -gerel
