Code Monkey home page Code Monkey logo

Comments (2)

dillof avatar dillof commented on July 23, 2024

To answer your questions:

  1. Yes, that's no problem.
  2. No, passing NULL would crash. If you pass NULL as error to zip_source_zip_file_create(), the error information is lost.
  3. There are more zip_source_foo() / zip_source_foo_create() function pairs that all take archive or error as arguments, and keeping them consistent seems like a good idea. We'll add a paragraph to all their man pages to document these arguments.

If you pass NULL as password, the default password for the archive is used. If you pass the empty string, that is used as password.

from libzip.

fdegros avatar fdegros commented on July 23, 2024

If you pass NULL as password, the default password for the archive is used. If you pass the empty string, that is used as password.

This might be worth documenting very clearly. In particular, this is a place where a NULL string and an empty string have different meanings and effects. This can be quite tricky.

This is also subtly different from the way zip_set_default_password treats its password parameter. See zip_set_default_password's documentation:

If password is NULL or the empty string, the default password is unset.

In that case, a NULL or an empty string have the same meaning and effect.

from libzip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.