Re: Problem with EMail Registration Code

From: Chuck Reed (
Date: 01/08/02

>  fopen(buf2, "w");         // to create the "empty" file
>  fl = fopen(buf2, "a");    // to append the "empty" file  (line 1981)

You shouldn't be doing all that.  You'll be making a new file each time and
re-writing over everyone else's emails.  Just make the empty file yourself
and change the above two lines to something like

if (!(fl = fopen(buf2, "a")))
   // Some kind of error logging

>  fprintf(fl, "%s", buf);   // write the message w/ the password
>  fclose(fl);               // close the file

These are ok.  Leave those.

You should always check to make sure your file pointer exists before making
i/o calls on it.


   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT