gets(3) replaced with fgets(3)