Merge pull request #81 from cbiffle/allow-long-sym-lines

icetime: allow longer lines in input asc files
This commit is contained in:
Clifford Wolf 2017-05-11 11:06:27 +02:00 committed by GitHub
commit 8611d612d4
1 changed files with 10 additions and 2 deletions

View File

@ -208,11 +208,19 @@ void read_pcf(const char *filename)
void read_config()
{
char buffer[128];
constexpr size_t line_buf_size = 65536;
char buffer[line_buf_size];
int tile_x, tile_y, line_nr = -1;
while (fgets(buffer, 128, fin))
while (fgets(buffer, line_buf_size, fin))
{
if (buffer[strlen(buffer) - 1] != '\n')
{
fprintf(stderr, "Input file contains very long lines.\n");
fprintf(stderr, "icetime cannot process it.\n");
exit(1);
}
if (buffer[0] == '.')
{
line_nr = -1;