Fixed issues with console titles not working correctly

This commit is contained in:
iDunnoDev
2023-01-14 01:33:30 +00:00
committed by iDunnoDev
parent 5b203d7f82
commit 8e3094f644
2 changed files with 6 additions and 2 deletions

View File

@ -1090,6 +1090,8 @@ struct vconsole* newconsole(char* title, int bgpreset)
if (strlen(title) > 0) 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)); safestrcpy(consoles[i].proctitle, title, sizeof(consoles[i].proctitle));
consoles[i].titlelocked = 1; consoles[i].titlelocked = 1;
} }

View File

@ -38,9 +38,11 @@ int main(int argc, char *argv[]) {
title[currenttitlelen] = ' '; title[currenttitlelen] = ' ';
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++; currenttitlelen++;
if (currenttitlelen >= 20) if (currenttitlelen >= 20)
{ {