Skip to content

Commit

Permalink
logo
Browse files Browse the repository at this point in the history
  • Loading branch information
ravachol committed Feb 2, 2024
1 parent 0d33edf commit 41218fd
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,24 +213,18 @@ int printLogo(SongData *songData)
{
int term_w, term_h;
getTermSize(&term_w, &term_h);
char *title = (char *)malloc(MAXPATHLEN);

char *title = (char *)calloc(MAXPATHLEN, sizeof(char)); // Initialize to zero
if (title == NULL)
{
return -1;
}
title[0] = '\0';

strcat(title, songData->metadata->title);
shortenString(title, term_w - indent - indent - 27);

if (nerdFontsEnabled)
{

if (isPaused())
printf(" \uf04c %s", title);
else
printf(" \uf04b %s", title);
}
else
{
printf(" %s", title);
}
printf(" %s", title);

free(title);
}
Expand Down

0 comments on commit 41218fd

Please sign in to comment.