Compare View
Commits (2)
-
Adds default case for unknown battery status code. Plugged in without battery now shows a plug symbol.
Showing
2 changed files
Show diff stats
battery.c
... | ... | @@ -38,9 +38,11 @@ int main() { |
38 | 38 | printf("\uf583 %d%%\n", life); |
39 | 39 | break; |
40 | 40 | case 7: /* disconnected */ |
41 | - printf("\uf590 Disconnected"); | |
41 | + printf("\uf492"); | |
42 | 42 | break; |
43 | + default: /* unknown code */ | |
44 | + printf("\uf590"); | |
43 | 45 | } |
44 | 46 | |
45 | - return 0; | |
47 | + return EXIT_SUCCESS; | |
46 | 48 | } | ... | ... |