diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2003-01-27 03:39:33 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2003-01-27 03:39:33 +0000 |
| commit | 5fe03aba3730a59ed55fe0eb72bf77e5a3a288eb (patch) | |
| tree | 4bed4faf934dfbf14110e7b7997083132aca15f9 | |
| parent | 33a155e400ad53ef923e902dad4881909677f005 (diff) | |
Notes
| -rw-r--r-- | lib/libutil/property.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/libutil/property.c b/lib/libutil/property.c index 0a31879ab609..34e6ee39b8d1 100644 --- a/lib/libutil/property.c +++ b/lib/libutil/property.c @@ -216,20 +216,23 @@ properties_read(int fd) break; } } + if (head == NULL && (head = property_alloc(NULL, NULL)) == NULL) + return (NULL); + return (head); } char * property_find(properties list, const char *name) { - if (!list || !name || !name[0]) - return NULL; - while (list) { - if (!strcmp(list->name, name)) - return list->value; + if (list == NULL || name == NULL || !name[0]) + return (NULL); + while (list != NULL) { + if (list->name != NULL && strcmp(list->name, name) == 0) + return (list->value); list = list->next; } - return NULL; + return (NULL); } void |
