| 274 | } |
| 275 | |
| 276 | static int toml_bounded_length(const char *text, size_t maximum, size_t *length_out) { |
| 277 | if (!text || !length_out) { |
| 278 | return TOML_EDIT_ERR; |
| 279 | } |
| 280 | size_t length = 0U; |
| 281 | while (length <= maximum && text[length] != '\0') { |
| 282 | length++; |
| 283 | } |
| 284 | if (length > maximum) { |
| 285 | return TOML_EDIT_ERR; |
| 286 | } |
| 287 | *length_out = length; |
| 288 | return TOML_EDIT_OK; |
| 289 | } |
| 290 | |
| 291 | static int toml_valid_path(const char *path) { |
| 292 | size_t len = 0U; |
no outgoing calls
no test coverage detected