More library stuff

Nice init and cleanup functions.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@97 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard committed 1998-12-20 21:57:39 +00:00
1 parent 750e0d00aa
commit 1779b684c1
8 files changed
+161 -9

No files matched your search

+4 -2
View File
@@ -66,6 +66,8 @@ int sensors_parse_chip_name(const char *orig_name, sensors_chip_name *res)
char *name = strdup(orig_name);
int i;
if (! name)
sensors_fatal_error("sensors_parse_chip_name","Allocating new name");
/* First split name in upto four pieces. */
if ((part4 = strrchr(name,'-')))
*part4++ = '\0';
@@ -155,8 +157,8 @@ DONE2:
if (!strcmp(name,"*"))
res->prefix = SENSORS_CHIP_NAME_PREFIX_ANY;
else
res->prefix = strdup(name);
else if (! (res->prefix = strdup(name)))
sensors_fatal_error("sensors_parse_chip_name","Allocating new name");
goto SUCCES;
SUCCES: