|
esp_iot_framework
v0.1.0-alpha
© 2026 AmakeSasha, distributed under a license Apache-2.0
|
Helper utility functions. More...
Functions | |
| static bool | eif_strempty (const char *const str) |
| Checks if a string is empty. More... | |
| static size_t | eif_strnlen (const char *const str, size_t max_allowed) |
| Computes the length of string. More... | |
This module contains inline helper utilities designed for secure and defensive manipulation of strings, preventing common buffer overflows and null-pointer dereferences.
|
inlinestatic |
Evaluates the provided string to determine if it is either a NULL pointer or points directly to a null-terminator (\0).
| str | Pointer to the string. Can be NULL. |
true: The string pointer is NULL or the string is empty ("").false: The string is valid and contains at least one character.Example of use:
|
inlinestatic |
Calculates the length of the string str, up to a maximum allowed bound specified by max_allowed.
| str | Constant pointer to the constant string to measure. |
| max_allowed | Maximum number of characters to examine, excluding the null-terminator. |
str if a null-terminator is found within the boundary. If str is NULL, returns 0U. If no null-terminator is found within the limit, returns the internal bounded limit.Example of use: