Changeset 5802 for lm-sensors/branches

Show
Ignore:
Timestamp:
11/28/09 13:34:57 (2 years ago)
Author:
khali
Message:

Fix a build warning in set_degstr. The prototype of iconv() is
stupid but won't change so we have to live with it.

Location:
lm-sensors/branches/lm-sensors-2.10
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-2.10/CHANGES

    r5768 r5802  
    1111  Program sensord: Fix a memory leak when a chip name is provided 
    1212  Program sensors: Fix a memory leak when a chip name is provided 
     13                   Fix iconv-related build warning in set_degstr 
    1314  Program sensors-detect: Fix detection of older DS1621 
    1415                          Rename the modprobe config file to lm_sensors.conf 
  • lm-sensors/branches/lm-sensors-2.10/prog/sensors/main.c

    r5738 r5802  
    135135     Don't forget to count the trailing \0! */ 
    136136  size_t deg_latin1_size = 3; 
    137   char *deg_latin1_text[2] = {"\260C", "\260F"}; 
     137  char deg_latin1_text[2][3] = {"\260C", "\260F"}; 
     138  char *deg_latin1_ptr = deg_latin1_text[fahrenheit]; 
    138139  size_t nconv; 
    139140  size_t degstr_size = sizeof(degstr); 
     
    142143  iconv_t cd = iconv_open(nl_langinfo(CODESET), "ISO-8859-1"); 
    143144  if (cd != (iconv_t) -1) { 
    144     nconv = iconv(cd, &(deg_latin1_text[fahrenheit]), &deg_latin1_size, 
     145    nconv = iconv(cd, &deg_latin1_ptr, &deg_latin1_size, 
    145146                  &degstr_ptr, &degstr_size); 
    146147    iconv_close(cd);