| 131 | } |
| 132 | |
| 133 | char *tpt_string(tpt_context *c, const char *s, size_t n) { |
| 134 | if (n == SIZE_MAX) { |
| 135 | tpt_fail(c, CBM_PINNED_TREE_LIMIT, "string size overflow"); |
| 136 | return NULL; |
| 137 | } |
| 138 | char *copy = tpt_alloc(c, n + 1, 1); |
| 139 | return copy && tpt_copy(c, copy, s, n) ? copy : NULL; |
| 140 | } |
| 141 | |
| 142 | bool tpt_oid(tpt_context *c, const char *oid, unsigned width) { |
| 143 | if (!oid || (width != 40 && width != 64)) |
no test coverage detected