But its already checking for the end of file marker, which is the #! and yes,
it is in the file.

--snip--
    for ( ; ; )
    {
        word = fread_word( fp );
        if ( !str_cmp( word, "#!" ) )
            break;

        if ( str_cmp( word, "#SKILL" ) )
        {
            bugf( "load_skills : key nonexistent (%s)", word );
            exit(1);
        }
        if ( i >= MAX_SKILL )
        {
            bug( "load_skills : number de skills mayor que MAX_SKILL", 0 );
            exit(1);
        }
        skill_table[i] = skzero;
        load_struct( fp, &sk, skillsavetable, &skill_table[i] );

#if defined(PART_SPELLS)
        if ( skill_table[i].spell_fun != spell_null 
             && skill_table[i].name[0] != '\0'
             && str_cmp(skill_table[i].name, "reserved"))
        {
            MAX_SPELL = MAX_SPELL + 1;
            spell_table[t] = spzero;
            spell_table[t].name = skill_table[i].name;
--snip--

--- Ben <[EMAIL PROTECTED]> wrote:
> its crashing because its trying to read information that is not there. I
> think ÿ is equivalent to nothingness (not NULL), as ive had this same error
> before. just read one word, or line or whatever, and then compare it.
> 
> i suggest making the EOF text something like END, so its easy to put in if
> you have to edit the file offline.
> 
> ----- Original Message -----
> From: "dat one guy" <[EMAIL PROTECTED]>
> To: "Ben" <[EMAIL PROTECTED]>
> Sent: Monday, August 19, 2002 9:22 PM
> Subject: Re: Changing the way skills and spells are handled...
> 
> 
> > Ok, I can understand that, but, how am I supposed to compare it if it
> crashes
> > when it tries to read it?
> > Or are you saying that the ÿ character is the 'end of file' character? and
> that
> > its not checking correctly?
> >
> > --- Ben <[EMAIL PROTECTED]> wrote:
> > > If you keep looping (when reading) from the file, and each time check to
> see
> > > if the data read is equivalent to the text that marks the end of the
> file,
> > > it is important to have the correct format for comparing strings.
> > >
> > > Eg.
> > >
> > > if (strcmp(datafromfile,END_MARKER))
> > >
> > > is different to
> > >
> > > if (datafromfile == END_MARKER)
> > >
> > > ----- Original Message -----
> > > From: "dat one guy" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>; <[email protected]>
> > > Sent: Monday, August 19, 2002 9:00 PM
> > > Subject: RE: Changing the way skills and spells are handled...
> > >
> > >
> > > > THen what?
> > > > I tried using str_dup, but the same thing happened...and why would it
> > > matter if
> > > > the problem is when its reading from the file? Not trying to be rude,
> > > rather
> > > > just wondering...
> > > >
> > > > --- [EMAIL PROTECTED] wrote:
> > > > > Tsk tsk tsk... strings don't equal strings, you know, not like this,
> > > > > anyways...
> > > > >
> > > >
> > > >
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > HotJobs - Search Thousands of New Jobs
> > > > http://www.hotjobs.com
> > > >
> > > > --
> > > > ROM mailing list
> > > > [email protected]
> > > > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> > > >
> > >
> > > --
> > > ROM mailing list
> > > [email protected]
> > > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > HotJobs - Search Thousands of New Jobs
> > http://www.hotjobs.com
> >


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

Reply via email to