Removed usage message from dbStateCreate because it is not only a shell function but an API as well. But kept check for NULL. Added check for NULL in dbStateFind as well.

This commit is contained in:
2018-09-28 11:36:02 +02:00
parent d44f5616a9
commit b2f3bafa64
+4 -3
View File
@@ -37,6 +37,9 @@ dbStateId dbStateFind(const char *name)
ELLNODE *node;
dbStateId id;
if (!name)
return NULL;
for (node = ellFirst(&states); node; node = ellNext(node)) {
id = CONTAINER(node, dbState, node);
if (strcmp(id->name, name) == 0)
@@ -50,10 +53,8 @@ dbStateId dbStateCreate(const char *name)
dbStateId id;
if (!name)
{
printf("Usage: dbStateCreate (\"name\")\n");
return NULL;
}
if ((id = dbStateFind(name)))
return id;