Browse Source
removed unnecessary fp, shorter return 0 and fixed compiler warning in vol_perc
master
Aaron Marcher
9 years ago
No known key found for this signature in database
GPG Key ID: 74B048E5C2474F9A
1 changed files with
3 additions and
4 deletions
-
slstatus.c
|
|
@ -269,10 +269,9 @@ static char * |
|
|
hostname(void) |
|
|
hostname(void) |
|
|
{ |
|
|
{ |
|
|
char buf[HOST_NAME_MAX]; |
|
|
char buf[HOST_NAME_MAX]; |
|
|
FILE *fp; |
|
|
|
|
|
|
|
|
|
|
|
if (gethostname(buf, sizeof(buf)) == -1) { |
|
|
if (gethostname(buf, sizeof(buf)) == -1) { |
|
|
warn(1, "hostname"); |
|
|
warn("hostname"); |
|
|
return smprintf(UNKNOWN_STR); |
|
|
return smprintf(UNKNOWN_STR); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -498,9 +497,9 @@ vol_perc(const char *card) |
|
|
snd_mixer_close(handle); |
|
|
snd_mixer_close(handle); |
|
|
|
|
|
|
|
|
if (max == 0) |
|
|
if (max == 0) |
|
|
return smprintf("%d%%", 0); |
|
|
return smprintf("0%%"); |
|
|
else |
|
|
else |
|
|
return smprintf("%d%%", ((uint_fast16_t)(vol * 100) / max)); |
|
|
return smprintf("%lu%%", ((uint_fast16_t)(vol * 100) / max)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static char * |
|
|
static char * |
|
|
|