Xref: utzoo comp.unix.questions:25201 comp.lang.c:31554 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions,comp.lang.c Subject: Re: Strcpy on SysV vs. BSD. Message-ID: <4008@auspex.auspex.com> Date: 2 Sep 90 22:13:09 GMT References: <24351@adm.BRL.MIL> <13724@smoke.BRL.MIL> Followup-To: comp.lang.c Organization: Auspex Systems, Santa Clara Lines: 29 >Heavens, you've made one of the most common blunders made by novice C >programmers. Or, to put it another way, "just because routine 'foobar()' is defined as taking a 'char *' as an argument doesn't mean: 1) what you pass to it has to be a variable declared as a 'char *' or 2) that you can just pass it any random variable declared as a 'char *'." I suspect the reason some novice C programmers make this blunder is that they see something like int stat(path, buf) char *path; struct stat *buf; in the manual, and think "ok, I have to declare a 'struct stat *' to pass to 'stat()'," and do something such as struct stat *buf; ... if (stat("my_file", buf) < 0) ...