Initialize mapping memory

This commit is contained in:
Iwan Timmer
2017-06-25 12:43:50 +02:00
parent 1b4e36646d
commit 9d26b22868
2 changed files with 3 additions and 2 deletions

View File

@@ -39,7 +39,8 @@ struct mapping* mapping_parse(char* mapping) {
strncpy(map->guid, guid, sizeof(map->guid));
strncpy(map->name, name, sizeof(map->name));
memset(&map->abs_leftx, -1, sizeof(short) * 31);
char* option;
while ((option = strtok_r(NULL, ",", &strpoint)) != NULL) {
char *key = NULL, *value = NULL;

View File

@@ -258,7 +258,7 @@ int main(int argc, char* argv[]) {
exit(-1);
}
struct mapping* mappings;
struct mapping* mappings = NULL;
if (config.mapping != NULL)
mappings = mapping_load(config.mapping, config.debug_level > 0);