Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!gem.mps.ohio-state.edu!apple!sun-barr!rutgers!att!chinet!john From: john@chinet.chi.il.us (John Mundt) Newsgroups: comp.lang.c Subject: Re: strcat/access question Message-ID: <9733@chinet.chi.il.us> Date: 3 Oct 89 14:10:42 GMT References: <5409@umd5.umd.edu> Reply-To: john@chinet.chi.il.us (John Mundt) Organization: Chinet - Public Access Unix Lines: 21 In article <5409@umd5.umd.edu> jjk@astro.UMD.EDU writes: >Here is a section of code: > >if((home=getenv("HOME"))==(char *) 0) >printf("%d:\n", access(strcat(home, "/astro/data/obs.list"), 4)); home is a char pointer, pointing to somewhere in the environmental variable area that was passed to main since that is where getenv() looks for things like HOME. main(int argc, char **argv, char **env) When you concatenated home with the rest of the path, it would have to step on other environmental variables, probably one that was needed by access(). -- --------------------- John Mundt Teachers' Aide, Inc. P.O. Box 1666 Highland Park, IL john@chinet.chi.il.us (312) 998-5007 (Day voice) || -432-8860 (Answer Mach) && -432-5386 Modem