Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!cornell!uw-beaver!milton!ogicse!intelhf!ichips!iwarp.intel.com!inews!nevin!bhoughto From: bhoughto@nevin.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Can't type ten steenking lines without a glaring bug... Message-ID: <3676@inews.intel.com> Date: 5 Apr 91 04:25:50 GMT Article-I.D.: inews.3676 References: <3646@inews.intel.com> <15705@smoke.brl.mil> <3661@inews.intel.com> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 13 In article <3661@inews.intel.com> bhoughto@hopi.intel.com (Blair P. Houghton, simpering, compiler-wastrel, code-anal weenie) writes: > stat( "filename", &stb ); > buf = (char *) malloc ( stb.st_size * (sizeof (char *)) ); > fp = fopen( "filename", "r"); > fread( buf, stb.st_size, 1, fp ); /* yippee! */ Of course, the second line above should be buf = (char *) malloc ( stb.st_size ); --Blair "I wash colored things in hot water all the time, too..."