summaryrefslogtreecommitdiff
path: root/build/parseScript.c
diff options
context:
space:
mode:
Diffstat (limited to 'build/parseScript.c')
-rw-r--r--build/parseScript.c10
1 files changed, 4 insertions, 6 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;
}