2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-04 00:05:10 +00:00

Move degrees string construction into a single, common place.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2252 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2004-01-31 10:17:15 +00:00
parent 3eaffe23d3
commit 8a64c5fd31
2 changed files with 46 additions and 43 deletions

View File

@@ -54,6 +54,8 @@ sensors_chip_name chips[CHIPS_MAX];
int chips_count=0;
int do_sets, do_unknown, fahrenheit, show_algorithm, hide_adapter, hide_unknown;
char degstr[5]; /* store the correct string to print degrees */
void print_short_help(void)
{
printf("Try `%s -h' for more information\n",PROGRAM);
@@ -245,6 +247,14 @@ int main (int argc, char *argv[])
close_config_file();
/* build the degrees string */
sprintf(degstr, "%c", 176);
if (fahrenheit) {
strcat(degstr, "F");
} else {
strcat(degstr, "C");
}
if(do_the_real_work(&error)) {
sensors_cleanup();
exit(error);