[OCLUG-devel] fopen doesn't like my path

Christopher Smith x at xman.org
Sun Nov 20 21:34:44 PST 2005


Doug Jolley wrote:

> Hi, Michael.  Thanks for responding.  I got it figured out.  It turns 
> out (apparently) that when one extracts a token from a string using 
> strtok a newline character is appended to the token.  It was the 
> trailing newline character in the path token that fopen didn't like 
> (as it shouldn't).  Once I chopped it off everything worked just 
> fine.  It did have me going for quite a while though.

Hehe, just got your post and Michael's. ;-)

strtok shouldn't be inserting a trailing newline anywhere. The only 
character it inserts is a NULL (which replaces the delimiter). Are you 
sure something else wasn't inserting the newline (or for that matter, 
the newline might have already been there)?

--Chris


More information about the OCLUG-devel mailing list