diff --git a/lightningd/lightningd.h b/lightningd/lightningd.h index ba53ed767..fd161f7c4 100644 --- a/lightningd/lightningd.h +++ b/lightningd/lightningd.h @@ -89,7 +89,7 @@ struct lightningd { struct pubkey id; /* My name is... my favorite color is... */ - char *alias; /* At least 32 bytes (zero-filled) */ + u8 *alias; /* At least 32 bytes (zero-filled) */ u8 *rgb; /* tal_len() == 3. */ /* Any pending timers. */ diff --git a/lightningd/options.c b/lightningd/options.c index 75923388c..b3a7979fa 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -168,8 +168,8 @@ static char *opt_set_alias(const char *arg, struct lightningd *ld) */ if (strlen(arg) > 32) return tal_fmt(NULL, "Alias '%s' is over 32 characters", arg); - ld->alias = tal_arrz(ld, char, 33); - strncpy(ld->alias, arg, 32); + ld->alias = tal_arrz(ld, u8, 33); + strncpy((char*)ld->alias, arg, 32); return NULL; } @@ -572,11 +572,11 @@ void setup_color_and_alias(struct lightningd *ld) memcpy(&noun, der+3+sizeof(adjective), sizeof(noun)); noun %= ARRAY_SIZE(codename_noun); adjective %= ARRAY_SIZE(codename_adjective); - ld->alias = tal_arrz(ld, char, 33); + ld->alias = tal_arrz(ld, u8, 33); assert(strlen(codename_adjective[adjective]) + strlen(codename_noun[noun]) < 33); - strcpy(ld->alias, codename_adjective[adjective]); - strcat(ld->alias, codename_noun[noun]); + strcpy((char*)ld->alias, codename_adjective[adjective]); + strcat((char*)ld->alias, codename_noun[noun]); } }