mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-26 09:56:29 -05:00
Avoid redundant strlen and duplicate traversals when loading content strings
This commit is contained in:
parent
969cb5ca31
commit
3d7a722ab2
5 changed files with 99 additions and 25 deletions
|
|
@ -36,6 +36,12 @@ void* calloc_nofail(size_t count, size_t size);
|
|||
*/
|
||||
char* strdup_nofail(const char* str);
|
||||
|
||||
/**
|
||||
* Safe strndup with known length.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
char* strndup_nofail(const char* str, size_t size);
|
||||
|
||||
/**
|
||||
* Helper for printing an error about a failed allocation.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue