Commit 7887053e84362ac46b77edbfbeca03c1fa9d370d
1 parent
a38e4cd6
Exists in
master
Unknown and plugged in
Adds default case for unknown battery status code. Plugged in without battery now shows a plug symbol.
Showing
2 changed files
with
4 additions
and
2 deletions
Show diff stats
battery
No preview for this file type
battery.c
@@ -38,9 +38,11 @@ int main() { | @@ -38,9 +38,11 @@ int main() { | ||
38 | printf("\uf583 %d%%\n", life); | 38 | printf("\uf583 %d%%\n", life); |
39 | break; | 39 | break; |
40 | case 7: /* disconnected */ | 40 | case 7: /* disconnected */ |
41 | - printf("\uf590 Disconnected"); | 41 | + printf("\uf1e6 Plugged"); |
42 | break; | 42 | break; |
43 | + default: /* unknown code */ | ||
44 | + printf("\uf590"); | ||
43 | } | 45 | } |
44 | 46 | ||
45 | - return 0; | 47 | + return EXIT_SUCCESS; |
46 | } | 48 | } |