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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user