common: change fscanf to fgets