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, Bing, DotBot

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

read_log in db.c
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Aug 18, 2006, 9:03 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,874
JoinedJul 26, 2005

NOTE_DATA *read_log( FILE * fp )
{
   NOTE_DATA *nlog;
   char *word;
   CREATE( nlog, NOTE_DATA, 1 );

   for( ;; )
   {
      word = fread_word( fp );

      if( !str_cmp( word, "Sender" ) )
         nlog->sender = fread_string( fp );
      else if( !str_cmp( word, "Date" ) )
         nlog->date = fread_string( fp );
      else if( !str_cmp( word, "Subject" ) )
         nlog->subject = fread_string( fp );
      else if( !str_cmp( word, "Text" ) )
         nlog->text = fread_string( fp );
      else if( !str_cmp( word, "Endlog" ) )
      {
         fread_to_eol( fp );
         nlog->next = NULL;
         nlog->prev = NULL;
         return nlog;
      }
      else
      {
         DISPOSE( nlog );
         bug( "%s", "read_log: bad key word." );
         return NULL;
      }
   }
}

It's only takeing into account that a bad keyword is got before the other data. Before disposeing of nlog it should really free up the other data if it exist.
       
Pages:<< prev 1 next >>