Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!asuvax!hrc!force!covertr From: covertr@force.UUCP (Richard E. Covert) Newsgroups: alt.sources Subject: Re: pcal Summary: pcal strtok() function Keywords: pcal Message-ID: <485d83ed.14a1f@force.UUCP> Date: 31 Jan 90 15:13:17 GMT References: <1546@mipos3.intel.com> Distribution: alt Organization: gte Lines: 32 In article <1546@mipos3.intel.com>, jmasters@pcocd2.intel.com (Justin Masters ~) writes: > > > Is there any idea why pcal does not seem to work properly on a Sun386i? > > ----------------------------------------------------------------------------- > "Beatings will continue until morale | Justin Masters > improves." | > - management | jmasters@fmdgr1.intel.com Well, pcal seems to work OK on our Apollo workstations but when I ported it to my home computer (an Atari Mega ST4 running MarkWilliams C) it wouldn't read the calendar file. It seems that the UNIX strtok() function operates differently than the MWC strtok() does. I found that the MWC strtok() needed an extra NULL terminator at the end of the original string, otherwise MWC's strtok() would continue past the end of the original string under certain situations. What I found was that if I tokenized a very long string and then tried to tokenize a short string that MWC's strtok() was continuing past the end of the short string and was tokenizing parts of the previous longer string. But, by placing an extra NULL terminator, MWC's strtok() was detecting the end of the short string proplerly. I don't know if this helps you any but it is what I found when porting strok() to my home computer. Good luck with your problem!! -- Richard E. Covert, Lead Engineer of Software Tools Group AG Communications Systems, Phoenix AZ (602) - 581-4652 TCP/IP: covertr@gtephx UUCP: {ncar!noao!asuvax | uunet!zardoz!hrc | att}!gtephx!covertr