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