Stop using fscanf()
and use fgets()
instead. fscanf()
is not good (nor safe) the way you are using it. Especially with postal codes. Since you are using the data as a string, you didn't leave room for the ending '\0'
Also, read this about scanf()
, which applies to fscanf()
too.