[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pdf-devel] pdf_time_span_negate()
From: |
Brad Hards |
Subject: |
Re: [pdf-devel] pdf_time_span_negate() |
Date: |
Sat, 13 Jun 2009 21:00:59 +1000 |
User-agent: |
KMail/1.9.10 |
On Saturday 13 June 2009 08:34:49 pm Brad Hards wrote:
> pdf_time_span_negate (pdf_time_span_t *p_span)
> {
> pdf_status_t p_status = PDF_OK;
> + if ( p_span == NULL )
> + {
> + return PDF_ERROR;
> + }
> pdf_i64_neg(p_span, *p_span, &p_status);
> - return PDF_OK;
> + return p_status;
> }
On further thought, whether that is the right fix depends on whether
pdf_i64_neg() should assume that its argument might be NULL (and therefore
check) or not.
This query is generally applicable - should the pdf_types.h operations protect
against NULL pointers, or should they assume that their arguments are already
protected by higher level functions?
Brad