* @brief Returns the raw string data. * * This function returns a pointer to the character array managed by the String object. * If the input String is NULL or uninitialized, an error is logged, and the function returns NULL. * * @param str The String object to retrieve data from. Must not be NULL. * @return A pointer to the character data, or NULL on error. */
| 1761 | |
| 1762 | if (str == NULL) { |
| 1763 | STRING_LOG("[string_to_int]: Error - Null String object."); |
| 1764 | return 0; |
| 1765 | } |
| 1766 | if (string_empty(str)) { |
| 1767 | STRING_LOG("[string_to_int]: Error - Empty string."); |
| 1768 | return 0; |
| 1769 | } |
| 1770 | |
| 1771 | int result = atoi(str->dataStr); |
| 1772 | STRING_LOG("[string_to_int]: Converted '%s' to integer %d.", str->dataStr, result); |
| 1773 | STRING_LOG("[string_to_int]: Function end."); |
nothing calls this directly
no outgoing calls
no test coverage detected