diff --git a/console.c b/console.c index d560042..cddbcd7 100644 --- a/console.c +++ b/console.c @@ -1090,6 +1090,8 @@ struct vconsole* newconsole(char* title, int bgpreset) if (strlen(title) > 0) { + // Clear any text in the proc title incase this was a pre used console + memset(consoles[i].proctitle, 0, sizeof(consoles[i].proctitle[0]) * sizeof(consoles[i].proctitle)); safestrcpy(consoles[i].proctitle, title, sizeof(consoles[i].proctitle)); consoles[i].titlelocked = 1; } diff --git a/screen.c b/screen.c index f08c309..02c08c0 100644 --- a/screen.c +++ b/screen.c @@ -38,9 +38,11 @@ int main(int argc, char *argv[]) { title[currenttitlelen] = ' '; currenttitlelen++; } - for (int x = 0; x <= sizeof(argv[i]); x++) + + char *sx; + for (sx = argv[i]; *sx != '\0'; sx++) { - title[currenttitlelen] = argv[i][x]; + title[currenttitlelen] = *sx; currenttitlelen++; if (currenttitlelen >= 20) {