I don\'t know exactly why a file pointer reads an extra line from a file, specifically the last line, here is the code:
FILE *fp ; fp = fopen (\"mac_ip.txt\"
You better test for fscanf return value before printing result. I bet that in the last iteration of your loop, fscanf calls fail and you print the last returned results.