X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=src%2Fcommand_db.c;h=110f91f4eb2ddcf9c1fade659375e35b493526b0;hb=67bcb0339e09a67fe1685cf81e35ccac18eba0c5;hp=7e60b1d3510386dd3101000acf3cc637025b3506;hpb=4d6dba920fe02c38aa234c4991d72418e802314a;p=plomrogue diff --git a/src/command_db.c b/src/command_db.c index 7e60b1d..110f91f 100644 --- a/src/command_db.c +++ b/src/command_db.c @@ -7,7 +7,8 @@ #include /* for strlen(), strtok() */ #include "main.h" /* for world global */ #include "readwrite.h" /* for textfile_sizes(), try_fopen(), try_fclose() */ -#include "misc.h" /* for try_malloc(), exit_trouble */ +#include "misc.h" /* for try_malloc() */ +#include "rexit.h" /* exit_trouble() */ @@ -81,9 +82,8 @@ extern void init_command_db() char * path = "config/commands"; FILE * file = try_fopen(path, "r", f_name); - uint16_t lines, linemax; - uint8_t test = textfile_sizes(file, &linemax, &lines); - exit_trouble(test, f_name, "textfile_sizes()"); + uint16_t lines; + uint16_t linemax = textfile_sizes(file, &lines); char line[linemax + 1]; struct Command * cmds = try_malloc(lines * sizeof(struct Command), f_name);