char * f);
/* Wrapper: Call textfile_sizes() from function called "f" to get max line
- * length of "file", exit via exit_err() with trouble_msg()-generated error
- * message on failure.
+ * length (includes newline char) of "file", exit via exit_err() with
+ * exit_trouble() on failure.
*/
extern uint16_t get_linemax(FILE * file, char * f);
char * path = "config/windows/toggle_order_and_active";
FILE * file = try_fopen(path, "r", f_name);
uint16_t linemax = get_linemax(file, f_name);
-
char win_order[linemax + 1];
try_fgets(win_order, linemax + 1, file, f_name);
try_fclose(file, f_name);
uint8_t i = 0;
- for (; i < linemax - 1; i++)
+ for (; i < strlen(win_order) - 1; i++)
{
if (NULL == strchr(world.winconf_ids, win_order[i]))
{