diff options
| author | Inqiyad Sabr <sabr@ariamath.xyz> | 2025-10-28 20:44:17 +0600 |
|---|---|---|
| committer | Inqiyad Sabr <sabr@ariamath.xyz> | 2025-10-28 20:44:17 +0600 |
| commit | 6a75fcff450e027cacf09b7765b89f18525b6f13 (patch) | |
| tree | 31ed37f494b0d2dd4b60379e273e38b3af2db912 /cmus.c | |
| parent | 52aa2298a1b42c3da24e3bb39fee1ed894231c03 (diff) | |
fixed cmus overflow
... somehow freezes the entire status.... maybe its... stuck (at EOF or smt)? that's all I can tell... maybe file descriptor problems
Diffstat (limited to 'cmus.c')
| -rw-r--r-- | cmus.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -6,13 +6,9 @@ FILE *cmus_stat; char cmus_str[64]; void cmus(void) { if (!cmus_stat) cmus_stat = fopen("/tmp/cmus-status","r"); - int len, c; - len = 0; if (cmus_stat) { - while (len < 64 && (c = fgetc(cmus_stat)) != EOF) - cmus_str[len++] = c; rewind(cmus_stat); - cmus_str[len] = '\0'; + fgets(cmus_str,64,cmus_stat); } block(cmus_str,FG,BG,BG); } |