| 451 | } |
| 452 | |
| 453 | static char *opt_set_alias(const char *arg, struct lightningd *ld) |
| 454 | { |
| 455 | assert(arg != NULL); |
| 456 | |
| 457 | ld->alias = tal_free(ld->alias); |
| 458 | /* BOLT #7: |
| 459 | * |
| 460 | * * [`32*byte`:`alias`] |
| 461 | *... |
| 462 | * - MUST set `alias` to a valid UTF-8 string, with any |
| 463 | * `alias` trailing-bytes equal to 0. |
| 464 | */ |
| 465 | if (strlen(arg) > 32) |
| 466 | return tal_fmt(tmpctx, "Alias '%s' is over 32 characters", arg); |
| 467 | ld->alias = tal_arrz(ld, u8, 33); |
| 468 | strncpy((char*)ld->alias, arg, 32); |
| 469 | return NULL; |
| 470 | } |
| 471 | |
| 472 | static char *opt_set_offline(struct lightningd *ld) |
| 473 | { |
nothing calls this directly
no test coverage detected