home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.hackers
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!taronga!peter
- From: peter@taronga.com (Peter da Silva)
- Subject: Re: not a test
- Message-ID: <HWMHKR7@taronga.com>
- Sender: peter@taronga.com (Peter da Silva)
- Organization: Taronga Park BBS
- References: <1992Jul20.185304.837@amhux2.amherst.edu> <ik89NB1w164w@kzdoos.hacktic.nl> <1992Jul23.075512.21400@cbfsb.cb.att.com>
- Date: Thu, 23 Jul 1992 12:27:42 GMT
- Approved: peter@taronga.com
- Lines: 20
-
- In article <1992Jul23.075512.21400@cbfsb.cb.att.com> cooper@cbnewsg.cb.att.com (Ralph 'Hairy' Moonen) writes:
- >And you loose brownie points for using sscanf.
-
- Agreed. Personally, I'd use strchr:
-
- i = 0;
- while(buf && *buf) {
- flds[i++] = buf;
- if(buf = strchr(buf, ' ')) {
- *buf++ = '\0';
- while(isspace(*buf)) buf++;
- }
- }
-
- Don't forget to null-terminate the strings!
- --
- `-_-'
- Have you hugged your wolf today? 'U`
-
- Peter da Silva, Taronga Park BBS, Houston, TX +1 713 568 0480/1032
-