fscanf prob

From: Michael Gallagher (m_gally@HOTMAIL.COM)
Date: 01/04/00


i've been trying to make the shop's bank account save to a seperate file.
(i know there's probably an easier way to do it but this suits me fine)

this is the code that writes the file:

  if (!(bank = fopen(buf1, "w"))) {
    perror("SYSERR: Error saving bank file");
    return;
  }
  fprintf(bank, "%d\n", SHOP_BANK(shop_nr));
  fclose(bank);

and this is the code that reads it:

     if (!(bank = fopen(fbank, "r"))) {
       return;
     }
     fscanf(bank, " %d ", temp);
     SHOP_BANK(shop_nr) = temp;
     fclose(bank);

and it saves fine, just when it reads at bootup the mud freezes.
I can't figure out whats wrong.

Any help much appreciated.
Michael Gallagher


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT