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

Function fromwire_wirestring

wire/fromwire.c:265–279  ·  view source on GitHub ↗

* Don't allow control chars except spaces: we only use this for stuff * from subdaemons, who shouldn't do that. */

Source from the content-addressed store, hash-verified

263 * from subdaemons, who shouldn't do that.
264 */
265char *fromwire_wirestring(const tal_t *ctx, const u8 **cursor, size_t *max)
266{
267 size_t i;
268
269 for (i = 0; i < *max; i++) {
270 if ((*cursor)[i] == '\0') {
271 char *str = tal_arr(ctx, char, i + 1);
272 fromwire(cursor, max, str, i + 1);
273 return str;
274 }
275 if ((*cursor)[i] < ' ')
276 break;
277 }
278 return fromwire_fail(cursor, max);
279}
280
281void fromwire_siphash_seed(const u8 **cursor, size_t *max,
282 struct siphash_seed *seed)

Callers 3

fromwire_onchain_feeFunction · 0.50
fromwire_accountFunction · 0.50
fromwire_opt_wirestringFunction · 0.50

Calls 2

fromwireFunction · 0.70
fromwire_failFunction · 0.70

Tested by

no test coverage detected