pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] Patch for FS#118


From: Jose E . Marchesi
Subject: Re: [pdf-devel] Patch for FS#118
Date: Mon, 19 Apr 2010 22:56:09 +0200 (CEST)

    Here is a patch for new method pdf_fsys_build_path(). I tested it
    on GNU/Linux.

    address@hidden ...
    +Variable-length pdf_text_t object list, last element must be NULL.

It is dangerous to rely on the client of the function to terminate the
list with a NULL value: if she forgets about the rule then the results
would be unpredictable.

I think that it would be better to use an explicit parameter with the
number of expected elements:

pdf_status_t pdf_fsys_build_path (pdf_fsys_t filesystem,
                                  pdf_text_t *output,
                                  pdf_size_t num_elements,
                                  pdf_text_t first_element,
                                  ...);

In that way we would still get unpredictable effects if there is a
mismatch between 'num_elements' and the list of elements, but the bug
could be found by inspecting the code.  What do you think?

    Could anyone test it under win32 ?

It compiles with mingw32, so I guess it should be ok.  The tests are
not yet working under wine (I get an error from the check library) but
if it compiles with mingw32 it is enough for now.

--
Jose E. Marchesi    address@hidden
GNU Project         http://www.gnu.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]