aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parser.c19
-rw-r--r--src/ui.c2
2 files changed, 17 insertions, 4 deletions
diff --git a/src/parser.c b/src/parser.c
index 052acb4..d8ad576 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -73,7 +73,8 @@ void parse_config()
assert((size_t)(tail - buf) <= file_size);
++tail;
}
- head = tail+1;;
+
+ head = tail++;
continue;
}
else if (*tail == '=')
@@ -119,11 +120,23 @@ void parse_config()
}
else if (!strcmp(key, "project.script"))
{
- config.projects[config.project_count-1].script_path = strdup(value);
+ if (config.project_count > 0)
+ {
+ if (config.projects[config.project_count-1].script_path)
+ free(config.projects[config.project_count-1].script_path);
+
+ config.projects[config.project_count-1].script_path = strdup(value);
+ }
}
else if (!strcmp(key, "project.description"))
{
- config.projects[config.project_count-1].description = strdup(value);
+ if (config.project_count > 0)
+ {
+ if (config.projects[config.project_count-1].description)
+ free(config.projects[config.project_count-1].description);
+
+ config.projects[config.project_count-1].description = strdup(value);
+ }
}
key = NULL;
diff --git a/src/ui.c b/src/ui.c
index 25c810e..2740ef7 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -329,7 +329,7 @@ void print_project_list()
"<td class=\"%s\">%s</td>"
"</tr>",
project->name, project->name,
- project->description,
+ project->description ? project->description : "",
time, buildtime,
class, status
);