2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 06:15:15 +00:00

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/trunk@5801 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2009-11-28 12:26:44 +00:00
parent 8d3e7a742e
commit 8416f31add
2 changed files with 5 additions and 3 deletions

View File

@@ -125,15 +125,16 @@ 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, &degstr_ptr, &degstr_size);
nconv = iconv(cd, &deg_latin1_ptr, &deg_latin1_size,
&degstr_ptr, &degstr_size);
iconv_close(cd);
if (nconv != (size_t) -1)