diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/parseScript.c | 10 | ||||
-rw-r--r-- | build/parseSpec.c | 3 | ||||
-rw-r--r-- | build/spec.c | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/build/parseScript.c b/build/parseScript.c index ee24c93cb..6f6917c1e 100644 --- a/build/parseScript.c +++ b/build/parseScript.c @@ -26,11 +26,10 @@ static int addTriggerIndex(Package pkg, const char *file, list = list->next; } - if (last) { + if (last) index = last->index + 1; - } - tfe = xmalloc(sizeof(*tfe)); + tfe = xcalloc(1, sizeof(*tfe)); tfe->fileName = (file) ? xstrdup(file) : NULL; tfe->script = (script && *script != '\0') ? xstrdup(script) : NULL; @@ -38,11 +37,10 @@ static int addTriggerIndex(Package pkg, const char *file, tfe->index = index; tfe->next = NULL; - if (last) { + if (last) last->next = tfe; - } else { + else pkg->triggerFiles = tfe; - } return index; } diff --git a/build/parseSpec.c b/build/parseSpec.c index a1ac61b40..c86ed66ee 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -469,7 +469,7 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU closeSpec(spec); - spec->BASpecs = xmalloc(spec->BACount * sizeof(Spec)); + spec->BASpecs = xcalloc(spec->BACount, sizeof(Spec)); index = 0; if (spec->BANames != NULL) for (x = 0; x < spec->BACount; x++) { @@ -484,6 +484,7 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU #else addMacro(NULL, "_target_cpu", NULL, spec->BANames[x], RMIL_RPMRC); #endif + spec->BASpecs[index] = NULL; if (parseSpec(&(spec->BASpecs[index]), specFile, spec->rootURL, buildRootURL, 1, passPhrase, cookie, anyarch, force)) diff --git a/build/spec.c b/build/spec.c index c7bfcf44b..f6c1882cf 100644 --- a/build/spec.c +++ b/build/spec.c @@ -105,7 +105,7 @@ Package newPackage(Spec spec) Package p; Package pp; - p = xmalloc(sizeof(*p)); + p = xcalloc(1, sizeof(*p)); p->header = headerNew(); p->icon = NULL; |