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