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

Doug Jolley ddjolley at gmail.com
Mon Nov 21 09:30:35 PST 2005


>
> (or for that matter,
> the newline might have already been there)?
>

Chris, I think that was probably the case. The string that strtok was
parsing came from a data file. In this case the datafile was a text file
with colon delimited fields and newline delimited records. Guess what? The
particular field in question was the last field in the record therefore it
was followed by a newline character.

It occurs to me (now that I better understand this) that rather than
chopping off the trailing newline character what I should have done as the
fix was include a newline in the strtok delimiters.

Thanks for pointing out the error of my ways because I probably would have
gone away with the misconception that strtok appends a newline character and
that would have probably caused me additional problems in the future.

... doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://localhost.localdomain/pipermail/oclug-devel/attachments/20051121/92b597ef/attachment.html 


More information about the OCLUG-devel mailing list