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

Function print_utf8

devtools/bolt12-cli.c:162–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162static bool print_utf8(const char *fieldname, const utf8 *description)
163{
164 size_t len = tal_bytelen(description);
165 bool valid = utf8_check(description, len);
166
167 /* Decoded TLV utf8 fields are length-delimited, not necessarily NUL-terminated. */
168 if (len != 0 && description[len - 1] == '\0')
169 len--;
170
171 printf("%s: %.*s%s\n", fieldname,
172 (int)len, description,
173 valid ? "" : "(INVALID UTF-8)");
174 return valid;
175}
176
177static void print_node_id(const char *fieldname, const struct pubkey *node_id)
178{

Callers 1

mainFunction · 0.85

Calls 2

tal_bytelenFunction · 0.85
utf8_checkFunction · 0.50

Tested by

no test coverage detected