Fix a build warning in set_degstr. The prototype of iconv() is

stupid but won't change so we have to live with it.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-2.10@5802 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2009-11-28 12:34:57 +00:00
1 parent b1f0219462
commit 491730ad14
2 files changed
+4 -2

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ SVN-HEAD
Program eepromer: Fix array initialization overrun
Program sensord: Fix a memory leak when a chip name is provided
Program sensors: Fix a memory leak when a chip name is provided
Fix iconv-related build warning in set_degstr
Program sensors-detect: Fix detection of older DS1621
Rename the modprobe config file to lm_sensors.conf
Drop AMD K10 detection (unreliable sensors)
+3 -2
View File
@@ -134,14 +134,15 @@ static void set_degstr(void)
/* Size hardcoded for better performance.
Don't forget to count the trailing \0! */
size_t deg_latin1_size = 3;
char *deg_latin1_text[2] = {"\260C", "\260F"};
char deg_latin1_text[2][3] = {"\260C", "\260F"};
char *deg_latin1_ptr = deg_latin1_text[fahrenheit];
size_t nconv;
size_t degstr_size = sizeof(degstr);
char *degstr_ptr = degstr;
iconv_t cd = iconv_open(nl_langinfo(CODESET), "ISO-8859-1");
if (cd != (iconv_t) -1) {
nconv = iconv(cd, &(deg_latin1_text[fahrenheit]), &deg_latin1_size,
nconv = iconv(cd, &deg_latin1_ptr, &deg_latin1_size,
&degstr_ptr, &degstr_size);
iconv_close(cd);