MCPcopy Create free account
hub / github.com/ElementsProject/lightning / utf8_str

Function utf8_str

common/utils.c:206–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206char *utf8_str(const tal_t *ctx, const u8 *buf TAKES, size_t buflen)
207{
208 char *ret;
209
210 if (!utf8_check(buf, buflen)) {
211 if (taken(buf))
212 tal_free(buf);
213 return NULL;
214 }
215
216 /* Add one for nul term */
217 ret = tal_dup_arr(ctx, char, (const char *)buf, buflen, 1);
218 ret[buflen] = '\0';
219 return ret;
220}
221
222int tmpdir_mkstemp(const tal_t *ctx, const char *template TAKES, char **created)
223{

Callers 2

json_add_datastoreFunction · 0.85
decode_dFunction · 0.85

Calls 3

takenFunction · 0.85
tal_freeFunction · 0.85
utf8_checkFunction · 0.70

Tested by

no test coverage detected