Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generator: Wrap _as_c_str() getter for possibly-pointers in Option #860

Merged
merged 1 commit into from
Jan 11, 2024

Commits on Jan 11, 2024

  1. generator: Wrap _as_c_str() getter for possibly-pointers in Option

    While this function is already marked `unsafe` to represent cases where
    an invalid pointer might be dereferenced, it should at least be obvious
    to the caller that there is a real chance for `NULL` pointers in these
    `CStr` getters, which will now be returned as `None`.  This function
    won't be used in `Debug` now as the dereference operation is still
    `unsafe`.
    
    The `_as_c_str()` getters for static arrays is left untouched, as the
    data is read directly from the known-valid struct here.
    MarijnS95 committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    db695cf View commit details
    Browse the repository at this point in the history