Lines 24-30
Link Here
|
24 |
#include <errno.h> |
24 |
#include <errno.h> |
25 |
#include <locale.h> |
25 |
#include <locale.h> |
26 |
#include <langinfo.h> |
26 |
#include <langinfo.h> |
|
|
27 |
#ifndef WITHOUT_ICONV |
27 |
#include <iconv.h> |
28 |
#include <iconv.h> |
|
|
29 |
#endif |
28 |
|
30 |
|
29 |
#include "lib/sensors.h" |
31 |
#include "lib/sensors.h" |
30 |
#include "lib/error.h" |
32 |
#include "lib/error.h" |
Lines 116-126
void close_config_file(const char* confi
Link Here
|
116 |
|
118 |
|
117 |
static void set_degstr(void) |
119 |
static void set_degstr(void) |
118 |
{ |
120 |
{ |
|
|
121 |
const char *deg_default_text[2] = {" C", " F"}; |
122 |
|
123 |
#ifndef WITHOUT_ICONV |
119 |
/* Size hardcoded for better performance. |
124 |
/* Size hardcoded for better performance. |
120 |
Don't forget to count the trailing \0! */ |
125 |
Don't forget to count the trailing \0! */ |
121 |
size_t deg_latin1_size = 3; |
126 |
size_t deg_latin1_size = 3; |
122 |
char *deg_latin1_text[2] = {"\260C", "\260F"}; |
127 |
char *deg_latin1_text[2] = {"\260C", "\260F"}; |
123 |
const char *deg_default_text[2] = {" C", " F"}; |
|
|
124 |
size_t nconv; |
128 |
size_t nconv; |
125 |
size_t degstr_size = sizeof(degstr); |
129 |
size_t degstr_size = sizeof(degstr); |
126 |
char *degstr_ptr = degstr; |
130 |
char *degstr_ptr = degstr; |
Lines 134-139
static void set_degstr(void)
Link Here
|
134 |
if (nconv != (size_t) -1) |
138 |
if (nconv != (size_t) -1) |
135 |
return; |
139 |
return; |
136 |
} |
140 |
} |
|
|
141 |
#endif |
137 |
|
142 |
|
138 |
/* There was an error during the conversion, use the default text */ |
143 |
/* There was an error during the conversion, use the default text */ |
139 |
strcpy(degstr, deg_default_text[fahrenheit]); |
144 |
strcpy(degstr, deg_default_text[fahrenheit]); |