From owner-freebsd-current Fri Sep 6 10:45:22 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3145437B400; Fri, 6 Sep 2002 10:45:20 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F0D143E65; Fri, 6 Sep 2002 10:45:19 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.3/8.12.2) with ESMTP id g86HjAAg024822; Fri, 6 Sep 2002 19:45:10 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: bmah@FreeBSD.ORG Cc: freebsd-current@FreeBSD.ORG Subject: Re: libmd bug on -CURRENT In-Reply-To: Your message of "Fri, 06 Sep 2002 09:08:10 PDT." <200209061608.g86G8AOF001414@intruder.bmah.org> Date: Fri, 06 Sep 2002 19:45:10 +0200 Message-ID: <24821.1031334310@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Good catch. I'm surprised the compiler doesn't whine. Poul-Henning >Index: mdXhl.c >=================================================================== >RCS file: /usr/local/cvsroot/src/lib/libmd/mdXhl.c,v >retrieving revision 1.16 >diff -u -r1.16 mdXhl.c >--- mdXhl.c 25 Mar 2002 13:50:40 -0000 1.16 >+++ mdXhl.c 6 Sep 2002 16:02:52 -0000 >@@ -66,6 +66,7 @@ > len = stbuf.st_size - ofs; > if (lseek(f, ofs, SEEK_SET) < 0) return 0; > n = len; >+ i = 0; > while (n > 0) { > if (n > sizeof(buffer)) > i = read(f, buffer, sizeof(buffer)); > > > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message