Commit f2296313 by Rudolf

Show error when we do not support the file

Our special 0xff as EOF does not allow some files.
parent 259f5553
Showing with 5 additions and 0 deletions
...@@ -37,6 +37,11 @@ struct tree *create_tree(FILE *file) ...@@ -37,6 +37,11 @@ struct tree *create_tree(FILE *file)
if (c == EOF || c > MY_BUF-1) if (c == EOF || c > MY_BUF-1)
break; break;
if (c > MY_BUF-1 || c == EOF_CHAR) {
fprintf(stderr, "File not supported\n");
return NULL;
}
if (freq[c] == 0) if (freq[c] == 0)
charcount++; charcount++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment