fix compilation and setting parameters to null

This commit is contained in:
Enno Rehling 2015-11-09 13:55:09 +01:00
parent 2aafa2b54f
commit 6d0bcb246d
2 changed files with 8 additions and 5 deletions

View File

@ -20,6 +20,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
extern "C" {
#endif
struct unit;
struct faction;
struct attrib;
extern struct attrib_type at_otherfaction;

View File

@ -1160,11 +1160,13 @@ void set_param(struct param **p, const char *key, const char *data)
}
p = &(*p)->next;
}
par = malloc(sizeof(param));
par->name = _strdup(key);
par->data = _strdup(data);
par->next = *p;
*p = par;
if (data) {
par = malloc(sizeof(param));
par->name = _strdup(key);
par->data = _strdup(data);
par->next = *p;
*p = par;
}
}
void kernel_done(void)