home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Coupled create_winconfs() and init_winconfs() that were only called as a couple anyhow.
[plomrogue]
/
src
/
command_db.c
diff --git
a/src/command_db.c
b/src/command_db.c
index 2a37b405e505326f7e6faf8293211ee44ff825d2..25fcd24e90076da9ca8c5c75689c7b487525a6f3 100644
(file)
--- a/
src/command_db.c
+++ b/
src/command_db.c
@@
-81,7
+81,8
@@
extern void init_command_db(struct World * world)
FILE * file = fopen("config/commands", "r");
exit_err(NULL == file, world, err);
uint16_t lines, linemax;
FILE * file = fopen("config/commands", "r");
exit_err(NULL == file, world, err);
uint16_t lines, linemax;
- textfile_sizes(file, &linemax, &lines);
+ err = "Trouble in init_cmds() with textfile_sizes().";
+ exit_err(textfile_sizes(file, &linemax, &lines), world, err);
err = "Trouble in init_cmds() with malloc().";
char * line = malloc(linemax);
exit_err(NULL == line, world, err);
err = "Trouble in init_cmds() with malloc().";
char * line = malloc(linemax);
exit_err(NULL == line, world, err);
@@
-95,6
+96,7
@@
extern void init_command_db(struct World * world)
copy_tokenized_string(world, &cmds[i].dsc_long, "\n", err);
i++;
}
copy_tokenized_string(world, &cmds[i].dsc_long, "\n", err);
i++;
}
+ free(line);
world->cmd_db = malloc(sizeof(struct CommandDB));
world->cmd_db->cmds = cmds;
world->cmd_db->n = lines;
world->cmd_db = malloc(sizeof(struct CommandDB));
world->cmd_db->cmds = cmds;
world->cmd_db->n = lines;