diff options
author | Matt Wilson <msw@redhat.com> | 1999-08-29 16:08:29 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-08-29 16:08:29 +0000 |
commit | 213dad30df1d45ab0d881fa503038b0d2fd33759 (patch) | |
tree | bcfbf798551c3e1f1d5834cc7f0a7b99f84e1c42 /loader/modules.c | |
parent | e75440c28ad5ef1f6efcc6cf8e84fd8948021471 (diff) | |
download | anaconda-213dad30df1d45ab0d881fa503038b0d2fd33759.tar.gz anaconda-213dad30df1d45ab0d881fa503038b0d2fd33759.tar.xz anaconda-213dad30df1d45ab0d881fa503038b0d2fd33759.zip |
fixed dep file parsing
Diffstat (limited to 'loader/modules.c')
-rw-r--r-- | loader/modules.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/loader/modules.c b/loader/modules.c index 76ed3ec0e..7d32e2877 100644 --- a/loader/modules.c +++ b/loader/modules.c @@ -135,8 +135,7 @@ int mlLoadDeps(moduleDeps * moduleDepListPtr, const char * path) { /* found something */ nextDep->name = strdup(start); - i = strlen(chptr) / 3; - nextDep->deps = malloc(sizeof(char **) * i); + nextDep->deps = malloc(sizeof(char *) * (strlen(chptr) + 1)); start = chptr, i = 0; while (start && *start) { chptr = strchr(start, ' '); @@ -148,6 +147,8 @@ int mlLoadDeps(moduleDeps * moduleDepListPtr, const char * path) { start = NULL; while (start && *start && isspace(*start)) start++; } + nextDep->deps[i] = NULL; + nextDep->deps = realloc(nextDep->deps, sizeof(char *) * (i + 1)); nextDep++; start = end + 1; |