Path: utzoo!attcan!uunet!samsung!rex!ames!ncar!ico!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Memory Fault Message-ID: <17133@haddock.ima.isc.com> Date: 22 Jul 90 22:46:16 GMT References: <189@S5000.UUCP> <1990Jul22.035715.12899@zoo.toronto.edu> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 8 >if (buffer = (char *) malloc(strlen(string)) == NULL) Henry has already pointed out the two bugs here; I'd like to note that, as written, this code is assigning an integer expression to a pointer variable. Shame on you for ignoring the compiler warning, or shame on the compiler for silently accepting it. (This isn't the VMS compiler again, is it?) Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint