| 306 | } |
| 307 | |
| 308 | static bool runtime_bounded_length(const char *value, size_t capacity, size_t *length_out) { |
| 309 | if (!value || capacity == 0) { |
| 310 | return false; |
| 311 | } |
| 312 | for (size_t i = 0; i < capacity; i++) { |
| 313 | if (value[i] == '\0') { |
| 314 | if (length_out) { |
| 315 | *length_out = i; |
| 316 | } |
| 317 | return true; |
| 318 | } |
| 319 | } |
| 320 | return false; |
| 321 | } |
| 322 | |
| 323 | static bool runtime_wire_string_encode(uint8_t *out, size_t capacity, const char *value, |
| 324 | bool allow_empty) { |
no outgoing calls
no test coverage detected