pub unsafe fn yaml_strdup(str: *const u8) -> *mut u8Expand description
Duplicate a string using the system’s strdup function.
This function is a thin wrapper around the system’s strdup function,
used for string duplication within the LibYML crate.
§Safety
- This function is unsafe because it directly calls the system’s
strdupfunction, which can lead to undefined behaviour if misused. - The caller must ensure that the provided
stris either a valid pointer to a null-terminated string, or a null pointer. - If
stris a null pointer, this function returns a null pointer. - The caller is responsible for properly freeing the duplicated string using
the corresponding
yaml_freefunction when it is no longer needed.