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

Function fromwire_wirestring

wire/fromwire.c:238–252  ·  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

236 * from subdaemons, who shouldn't do that.
237 */
238char *fromwire_wirestring(const tal_t *ctx, const u8 **cursor, size_t *max)
239{
240 size_t i;
241
242 for (i = 0; i < *max; i++) {
243 if ((*cursor)[i] == '\0') {
244 char *str = tal_arr(ctx, char, i + 1);
245 fromwire(cursor, max, str, i + 1);
246 return str;
247 }
248 if ((*cursor)[i] < ' ')
249 break;
250 }
251 return fromwire_fail(cursor, max);
252}
253
254void fromwire_siphash_seed(const u8 **cursor, size_t *max,
255 struct siphash_seed *seed)

Callers 1

fromwire_chain_coin_mvtFunction · 0.50

Calls 2

fromwireFunction · 0.70
fromwire_failFunction · 0.70

Tested by

no test coverage detected