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" { extern "C" {
#endif #endif
struct unit;
struct faction; struct faction;
struct attrib; struct attrib;
extern struct attrib_type at_otherfaction; extern struct attrib_type at_otherfaction;

View File

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