- try_fgetc(file, f_name);
- }
-}
-
-
-
-static void read_log(char * read_buf, uint32_t linemax, FILE * file)
-{
- char * f_name = "read_log()";
- free(world.log);
- world.log = NULL;
- while (try_fgets(read_buf, linemax + 1, file, f_name))
- {
- int old_size = 0;
- if (NULL != world.log)
- {
- old_size = strlen(world.log);
- }
- int new_size = strlen(read_buf);
- char * new_log = try_malloc(old_size + new_size + 1, f_name);
- memcpy(new_log, world.log, old_size);
- int test = sprintf(new_log + old_size, "%s", read_buf);
- exit_trouble(test < 0, f_name, "sprintf()");
- free(world.log);
- world.log = new_log;