Commit fa39a095 authored by Alejandro Mery's avatar Alejandro Mery
Browse files

script: don't accept empty section or entry names

parent da2d50ae
...@@ -57,7 +57,7 @@ struct script_section *script_section_append(struct script *script, ...@@ -57,7 +57,7 @@ struct script_section *script_section_append(struct script *script,
struct script_section *section; struct script_section *section;
assert(script); assert(script);
assert(name); assert(name && *name);
if ((section = malloc(sizeof(*section)))) { if ((section = malloc(sizeof(*section)))) {
size_t l = strlen(name); size_t l = strlen(name);
...@@ -146,7 +146,7 @@ struct script_null_entry *script_null_entry_append(struct script *script, ...@@ -146,7 +146,7 @@ struct script_null_entry *script_null_entry_append(struct script *script,
assert(script); assert(script);
assert(!list_empty(&script->sections)); assert(!list_empty(&script->sections));
assert(name); assert(name && *name);
if ((entry = malloc(sizeof(*entry)))) { if ((entry = malloc(sizeof(*entry)))) {
script_entry_append(script, &entry->entry, script_entry_append(script, &entry->entry,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment