Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot, Yandex, Bing

Members: 0
Guests: 17
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
619
Alexander
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » clans.c
Forum Rules | Mark all | Recent Posts

clans.c
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 11, 2005, 4:34 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,874
JoinedJul 26, 2005

in clans.c
save_clan
change
      fprintf( fp, "Favour       %d\n", clan->favour );
      fprintf( fp, "Strikes      %d\n", clan->strikes );
      fprintf( fp, "Members      %d\n", clan->members );
      fprintf( fp, "MemLimit     %d\n", clan->mem_limit );
      fprintf( fp, "Alignment    %d\n", clan->alignment );
      fprintf( fp, "Board        %d\n", clan->board );
      fprintf( fp, "ClanObjOne   %d\n", clan->clanobj1 );
      fprintf( fp, "ClanObjTwo   %d\n", clan->clanobj2 );
      fprintf( fp, "ClanObjThree %d\n", clan->clanobj3 );
      fprintf( fp, "ClanObjFour  %d\n", clan->clanobj4 );
      fprintf( fp, "ClanObjFive  %d\n", clan->clanobj5 );
      fprintf( fp, "Recall       %d\n", clan->recall );
      fprintf( fp, "Storeroom    %d\n", clan->storeroom );
      fprintf( fp, "GuardOne     %d\n", clan->guard1 );
      fprintf( fp, "GuardTwo     %d\n", clan->guard2 );
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );
   }
   fclose( fp );

to this
      fprintf( fp, "Favour       %d\n", clan->favour );
      fprintf( fp, "Strikes      %d\n", clan->strikes );
      fprintf( fp, "Members      %d\n", clan->members );
      fprintf( fp, "MemLimit     %d\n", clan->mem_limit );
      fprintf( fp, "Alignment    %d\n", clan->alignment );
      fprintf( fp, "Board        %d\n", clan->board );
      fprintf( fp, "ClanObjOne   %d\n", clan->clanobj1 );
      fprintf( fp, "ClanObjTwo   %d\n", clan->clanobj2 );
      fprintf( fp, "ClanObjThree %d\n", clan->clanobj3 );
      fprintf( fp, "ClanObjFour  %d\n", clan->clanobj4 );
      fprintf( fp, "ClanObjFive  %d\n", clan->clanobj5 );
      fprintf( fp, "Recall       %d\n", clan->recall );
      fprintf( fp, "Storeroom    %d\n", clan->storeroom );
      fprintf( fp, "GuardOne     %d\n", clan->guard1 );
      fprintf( fp, "GuardTwo     %d\n", clan->guard2 );
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );
      fclose( fp );
      fp = NULL;
   }

save_council
change
   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_council: cant open %s", filename );
      perror( filename );
   }
   else
   {
      fprintf( fp, "#COUNCIL\n" );
      if( council->name )
         fprintf( fp, "Name         %s~\n", council->name );
      if( council->filename )
         fprintf( fp, "Filename     %s~\n", council->filename );
      if( council->description )
         fprintf( fp, "Description  %s~\n", council->description );
      if( council->head )
         fprintf( fp, "Head         %s~\n", council->head );
      if( council->head2 != NULL )
         fprintf( fp, "Head2        %s~\n", council->head2 );
      fprintf( fp, "Members      %d\n", council->members );
      fprintf( fp, "Board        %d\n", council->board );
      fprintf( fp, "Meeting      %d\n", council->meeting );
      if( council->powers )
         fprintf( fp, "Powers       %s~\n", council->powers );
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );

   }
   fclose( fp );

to this
   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_council: cant open %s", filename );
      perror( filename );
   }
   else
   {
      fprintf( fp, "#COUNCIL\n" );
      if( council->name )
         fprintf( fp, "Name         %s~\n", council->name );
      if( council->filename )
         fprintf( fp, "Filename     %s~\n", council->filename );
      if( council->description )
         fprintf( fp, "Description  %s~\n", council->description );
      if( council->head )
         fprintf( fp, "Head         %s~\n", council->head );
      if( council->head2 != NULL )
         fprintf( fp, "Head2        %s~\n", council->head2 );
      fprintf( fp, "Members      %d\n", council->members );
      fprintf( fp, "Board        %d\n", council->board );
      fprintf( fp, "Meeting      %d\n", council->meeting );
      if( council->powers )
         fprintf( fp, "Powers       %s~\n", council->powers );
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );
      fclose( fp );
      fp = NULL;
   }


Notice its just moving up the fclose( fp ); since other wise it could try to close a NULL file.
Also added in to make fp NULL.
       
Pages:<< prev 1 next >>