2
0

Allocate enough space for the NUL c-string delimitor.

This commit is contained in:
Maarten Billemont 2014-11-23 13:44:37 -05:00
parent 37ec21f5be
commit 1f7a49378b

View File

@ -230,10 +230,10 @@ const char *Identicon(const char *userName, const char *masterPassword) {
setupterm(NULL, STDERR_FILENO, NULL); setupterm(NULL, STDERR_FILENO, NULL);
initputvar(); initputvar();
tputs(tparm(tgetstr("AF", NULL), colorIdentifier), 1, putvar); tputs(tparm(tgetstr("AF", NULL), colorIdentifier), 1, putvar);
colorString = calloc(strlen(putvarc), sizeof(char)); colorString = calloc(strlen(putvarc) + 1, sizeof(char));
strcpy(colorString, putvarc); strcpy(colorString, putvarc);
tputs(tgetstr("me", NULL), 1, putvar); tputs(tgetstr("me", NULL), 1, putvar);
resetString = calloc(strlen(putvarc), sizeof(char)); resetString = calloc(strlen(putvarc) + 1, sizeof(char));
strcpy(resetString, putvarc); strcpy(resetString, putvarc);
} else { } else {
colorString = calloc(1, sizeof(char)); colorString = calloc(1, sizeof(char));