Changeset 4138

Show
Ignore:
Timestamp:
09/03/06 15:05:26 (8 years ago)
Author:
khali
Message:

Chop newline at the end of adapter name.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/lib/sysfs.c

    r4098 r4138  
    200200                        continue; 
    201201 
    202                 entry.adapter = strdup(attr->value); 
     202                /* NB: attr->value[attr->len-1] == '\n'; chop that off */ 
     203                entry.adapter = strndup(attr->value, attr->len - 1); 
    203204                if (!entry.adapter) 
    204205                        sensors_fatal_error(__FUNCTION__, "out of memory");