mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-10 16:30:50 +00:00
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:
1 parent
750e0d00aa
commit
1779b684c1
8 files changed
+161
-9
No files matched your search
+4
-2
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user