options: don't end default name with '-' in non-DEVELOPER mode.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-09-29 16:04:01 +09:30
parent de37586a97
commit aa9e15edb0

View File

@ -777,16 +777,16 @@ void setup_color_and_alias(struct lightningd *ld)
adjective %= ARRAY_SIZE(codename_adjective);
/* Only use 32 characters */
name = tal_fmt(ld, "%s%s-",
name = tal_fmt(ld, "%s%s",
codename_adjective[adjective],
codename_noun[noun]);
#if DEVELOPER
assert(strlen(name) < 32);
int taillen = 32 - strlen(name);
int taillen = 31 - strlen(name);
if (taillen > strlen(version()))
taillen = strlen(version());
/* Fit as much of end of version() as possible */
tal_append_fmt(&name, "%s",
tal_append_fmt(&name, "-%s",
version() + strlen(version()) - taillen);
#endif
assert(strlen(name) <= 32);