From owner-cvs-src@FreeBSD.ORG Fri Aug 8 02:47:03 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B934106575A; Fri, 8 Aug 2008 02:47:03 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 294708FC21; Fri, 8 Aug 2008 02:47:03 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m782l32t073099; Fri, 8 Aug 2008 02:47:03 GMT (envelope-from ache@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m782l3fi073098; Fri, 8 Aug 2008 02:47:03 GMT (envelope-from ache@repoman.freebsd.org) Message-Id: <200808080247.m782l3fi073098@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to ache@repoman.freebsd.org using -f From: "Andrey A. Chernov" Date: Fri, 8 Aug 2008 02:46:47 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/games/random randomize_fd.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2008 02:47:03 -0000 ache 2008-08-08 02:46:47 UTC FreeBSD src repository Modified files: games/random randomize_fd.c Log: SVN rev 181412 on 2008-08-08 02:46:47Z by ache 1) Fix longstanding math bug with denominator > 1 (wrong probability). Test case: random -f some_small_file 10000 (in most cases must be no output) 2) Prevent number of lines > RANDOM_MAX (overflow or nothing may be choosed) with EFBIG err() 3) After line is found, terminate list loop for -U case too, since nothing to do in the rest of the loop left. Revision Changes Path 1.5 +16 -8 src/games/random/randomize_fd.c