X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fcommand_db.c;h=fd7f4dc7a2f78ae431ebd0bf37ee52bfda574da1;hb=76bcc7383e9b111e02e83c2d822633cf1be88aab;hp=34db4dcd8db41087f789377c4e5941950e7e071f;hpb=7290dec4219eaa2325aa00ef6139f715743dba3a;p=plomrogue diff --git a/src/command_db.c b/src/command_db.c index 34db4dc..fd7f4dc 100644 --- a/src/command_db.c +++ b/src/command_db.c @@ -6,9 +6,9 @@ #include /* for uint8_t */ #include /* for strlen(), strtok() */ #include "main.h" /* for world global */ -#include "rexit.h" /* for exit_err() */ #include "readwrite.h" /* for textfile_sizes(), try_fopen(), try_fclose() */ #include "misc.h" /* for try_malloc() */ +#include "rexit.h" /* exit_trouble() */ @@ -79,12 +79,12 @@ extern char * get_command_longdsc(char * dsc_short) extern void init_command_db() { char * f_name = "init_command_db()"; - char * err_s = "Trouble in init_cmds() with textfile_sizes()."; char * path = "config/commands"; FILE * file = try_fopen(path, "r", f_name); uint16_t lines, linemax; - exit_err(textfile_sizes(file, &linemax, &lines), err_s); + uint8_t test = textfile_sizes(file, &linemax, &lines); + exit_trouble(test, f_name, "textfile_sizes()"); char line[linemax + 1]; struct Command * cmds = try_malloc(lines * sizeof(struct Command), f_name);