Xref: utzoo comp.lang.c:7538 comp.databases:747 Newsgroups: comp.lang.c,comp.databases Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: gotcha in strtok(3) Message-ID: <1988Feb25.081302.29803@utzoo.uucp> Keywords: strtok(3), getenv(3), gotcha, $PATH, $DBPATH Organization: U of Toronto Zoology References: <45@vsi.UUCP> Date: Thu, 25 Feb 88 08:13:02 GMT > The remedy is to copy the variable into a local or static > buffer and run strtok(3) from that, leaving the environment > alone. Better yet, actually, is to malloc space for it. That saves you from having to make assumptions about how long it can be. -- Those who do not understand Unix are | Henry Spencer @ U of Toronto Zoology condemned to reinvent it, poorly. | {allegra,ihnp4,decvax,utai}!utzoo!henry