Re: strtok() and EOL
- From: Flash Gordon <spam@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 20:42:15 +0000
Fernando Barsoba wrote:
Jack Klein wrote:On Tue, 29 Nov 2005 15:16:17 GMT, Fernando Barsoba <fbarsoba@xxxxxxxxxxx> wrote in comp.lang.c:
<snip>
Thanks to all for your comments. Indeed, the string I'm getting is "message:this is a test\r\n". And 'pmsg' comes also from a file. Oddly enough, I thought I opened the file in text mode. Here's the sequence of calls:"message:this is a test\r\n"
fp = open_file(argv[1], "r");
Yes, that is opening in text mode.
<snip>
As the comments pointed out, this seems to be a Windows issue. That's why in Linux works fine. I'm not opening the file in binary mode though..
See my previous post, it's a Cygwin issue. Specifically, Cygwin is emulation Unix to a degree (that is its purpose) so by default it used the Unix text file conventions. Ask on a Cygwin mailing list for the details.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
.
- References:
- strtok() and EOL
- From: Fernando Barsoba
- Re: strtok() and EOL
- From: Jack Klein
- Re: strtok() and EOL
- From: Fernando Barsoba
- strtok() and EOL
- Prev by Date: Re: Array size depending on symbol address
- Next by Date: Re: Array size depending on symbol address
- Previous by thread: Re: strtok() and EOL
- Next by thread: Re: strtok() and EOL
- Index(es):
Relevant Pages
|