List Archive
Thread
-
Error inconsistency between zip_open() and zip_ope,
Andreas Falkenhahn
(2018/01/01 15:09:51)
- Message not available
- Re: Error inconsistency between zip_open() and zip, Andreas Falkenhahn (2018/01/02 13:31:47)
- Message not available
Message
In zip_open() the "errorp" parameter may be NULL but in zip_open_from_source() it must be set. Since both APIs are described on the very same man page I think there is a high chance of developers passing NULL to zip_open_from_source() as well because it is allowed in zip_open(). I did it as well and haven't notice it until now when I saw that zip_open_from_source() crashed with non- zip files. That's why I'm proposing to either add an EXPLICIT note that "ze" must not be NULL to the man page or change the implementation of zip_open_from_source() to allow a NULL parameter for "ze". I'd prefer the second idea because in most use cases you aren't really interested in why exactly zip_open_from_source() failed so it would be more convenient if it were possible to set the error parameter to NULL in zip_open_from_source() as well. -- Best regards, Andreas Falkenhahn mailto:andreas%falkenhahn.com@localhost
Made by MHonArc.