On Oct 18, 2009, at 8:33 PM, Gary Kline wrote:

Guys,

maybe this can't be done reading in a file with fgets(buffer[128], fp),
then calling skiptags(), conditionally, to while () past ',' and '>'.

I know I need to calll skipTags with its address, skipTags (&buffer);, but then how to i
handle the variable "s" in skipTags?  Anybody?

The skipTags() you wrote doesn't return its result.

Without actually trying it I think this will work:


// redo, skip TAGS
char *skipTags( char *s )
{
       if( *s == '<' ) {
               while( *s && ( *s++ != '>' ) )
                    ;           // on a line of its own to make sure you see it
       }
       return s;
}

When not using a count to indicate how much data is in a char* you should always test for null. Testing for null is not a sure fire way to prevent buffer over runs but its better than nothing.

Use the above something like this:

char *buffPtr;

        buffPtr = skipTags( buffPtr );  //  advance over < > tags


--
David Kelly N4HHE, dke...@hiwaay.net
========================================================================
Whom computers would destroy, they must first drive mad.



_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to