if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
if (sscanf(buf, "%s %s %i", dummy, dummy, &temp) == 3)
ret = 1;
else
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
if (sscanf(buf, "%i", &temp) == 1)
ret = 1;
else
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
/* actually read the temp */
if (sscanf(buf, "%i", &temp) == 1)
ret = 1;
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
/* actually read the temp */
if (sscanf(buf, "%i", &temp) == 1)
ret = 1;
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
p = strchr(buf, ':');
if (p)
{
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
temp = atoi(buf);
temp /= 1000;
ret = 1;
return -999;
error:
if (f) fclose(f);
- f = NULL;
sensor_type = SENSOR_TYPE_NONE;
- if (sensor_name) free(sensor_name);
- sensor_name = NULL;
- if (sensor_path) free(sensor_path);
- sensor_path = NULL;
+ E_FREE(sensor_name);
+ E_FREE(sensor_path);
return -999;
}