forgot, make sure you have the check further down in too..

    for ( ; pword < word + MAX_INPUT_LENGTH; pword++ )
    {
        if ( feof(fp) )
            return word;

        *pword = getc( fp );

        if ( cEnd == ' ' ? isspace(*pword) : *pword == cEnd )
        {
            if ( cEnd == ' ' )
                ungetc( *pword, fp );
            *pword = '\0';
            return word;
        }
    }

- Valnir

----- Original Message ----- 
From: "Valnir" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, August 03, 2004 2:50 PM
Subject: Re: Fread_Word


> I had to add an extra check into my 'fread_word' function for a similar
> problem.
>
> for some reason it wasn't picking up the 'EOF' marker. so make sure that
you
> have
> the following check in your 'while' loop that is looking for space.
>
> while ( isspace( cEnd ) && !feof(fp) );
>
> mine only had the 'isspace' originally, and it was an issue.
>
> - Valnir
>
> ----- Original Message ----- 
> From: "Davion Kalhen" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Tuesday, August 03, 2004 2:23 PM
> Subject: Re: Fread_Word
>
>
> > Make sure there's a '\n' at the end of the #END. That could be it.
> >
> > Davion
> >
> > -- 
> > 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
>


Reply via email to