Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!cs.umn.edu!kksys!wd0gol!newave!john From: john@newave.UUCP (John A. Weeks III) Newsgroups: comp.lang.c Subject: Re: Can't type ten steenking lines without a glaring bug... Message-ID: <744@newave.UUCP> Date: 10 Apr 91 22:58:54 GMT References: <3646@inews.intel.com> <15705@smoke.brl.mil> <3661@inews.intel.com> <3676@inews.intel.com> Reply-To: john@newave.mn.org (John A. Weeks III) Organization: NeWave Communications Ltd, Eden Prairie, MN Lines: 18 In article <3676@inews.intel.com> bhoughto@nevin.intel.com (Blair P. Houghton) writes: >In article <3661@inews.intel.com> bhoughto@hopi.intel.com (Blair P. Houghton, simpering, compiler-wastrel, code-anal weenie) writes: >> buf = (char *) malloc ( stb.st_size * (sizeof (char *)) ); >Of course, the second line above should be > buf = (char *) malloc ( stb.st_size ); At least the buffer size was as big as or bigger than expected, rather than smaller. Buffer that are too small make running programs rather interesting.... 8-) -john- -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ John A. Weeks III (612) 942-6969 john@newave.mn.org NeWave Communications ...uunet!tcnet!wd0gol!newave!john