From owner-cvs-all Sun Oct 20 16:13:32 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C411937B401; Sun, 20 Oct 2002 16:13:31 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6AC1543E75; Sun, 20 Oct 2002 16:13:31 -0700 (PDT) (envelope-from tmm@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9KND6mV089922; Sun, 20 Oct 2002 16:13:06 -0700 (PDT) (envelope-from tmm@repoman.freebsd.org) Received: (from tmm@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9KND5Om089921; Sun, 20 Oct 2002 16:13:05 -0700 (PDT) Message-Id: <200210202313.g9KND5Om089921@repoman.freebsd.org> From: Thomas Moestl Date: Sun, 20 Oct 2002 16:13:05 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern subr_log.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG tmm 2002/10/20 16:13:05 PDT Modified files: sys/kern subr_log.c Log: Fix the calculations of the length of the unread message buffer contents. The code was subtracting two unsigned ints, stored the result in a log and expected it to be the same as of a signed subtraction; this does only work on platforms where int and long have the same size (due to overflows). Instead, cast to long before the subtraction; the numbers are guaranteed to be small enough so that there will be no overflows because of that. Revision Changes Path 1.51 +2 -2 src/sys/kern/subr_log.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message