From owner-svn-src-all@freebsd.org Thu Jul 28 13:02:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FF81BA5DBA for ; Thu, 28 Jul 2016 13:02:58 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18F43128D for ; Thu, 28 Jul 2016 13:02:57 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x235.google.com with SMTP id z8so85659980ywa.1 for ; Thu, 28 Jul 2016 06:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DucLEfkw/d2TNgZMEZsK38h0bH6dQ4zgnD2YfItKC5c=; b=cUr3JtP92FIgz4d/oOki1oBi+vz8gf3NG+h/HZsDDwhQi8lKpqWjdtInWBFzA7e5kL OqvHuGr6b189r9huthti/ZOSHWqB5atoO56RxXmFLMwr33ww7IqbBrAFI1OyWZTyngTH QGfLxYgo+e3Pohxdzyt/50KTZbcIPm9cgZ6+6acHDKbfZsvsApqyB2Y9vwPUY5niD/fm hBSa5uqQS3vXKxDj2i2C+U9FxbtWJ1ZtsIbr6wxIp8SNZVe3MQZrIEQR7NqsOnzHNMs7 jCs9R3hdOY7Wovb0ZPXsgj2UNK6THn1YwLGDy9xSwruoLpsKK2T11r7dNIxBwc8xobl3 kPyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DucLEfkw/d2TNgZMEZsK38h0bH6dQ4zgnD2YfItKC5c=; b=A+oBk/IAHxJ93O9zz2ZVKI7UCrT4rrHJb7L4U5jQqDrHfxm7326w8hIcrlkghCht6u Dl/nsXnUde/B4qvRPdHoyU+8nnVdqjCWQmSVsTgCdIZDsaKE5bJKndHeJ1/zJY42WlH6 /DA8WueJvFRezVOxsXbtKvVr4MIJZ/MR+ZorJkUto9gWEMzd0FXKQ1g+cP+lrCMXhuL/ NvrbgtyJILBp0IPao6Trp7Z1qNcOjV0ZFaZajWr7ekSqTy/LYMK0N8ww0CklVxf6hf1Z oB3x71IK4nQFsy1WN2jtRUxHgvbtsC1WCU14spNhIMmao4jarjQmpv7Ki+V2nxguE0YA Srkg== X-Gm-Message-State: AEkoouvm8QHX9UA4cW+pgpoSCAUVeu+Gq1wjVTv68VGoQv9qfCzwjMead9SBumM2PnnRadpyyyLE8B4rVl9clA== X-Received: by 10.13.253.134 with SMTP id n128mr28278352ywf.20.1469710977114; Thu, 28 Jul 2016 06:02:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Thu, 28 Jul 2016 06:02:56 -0700 (PDT) In-Reply-To: <20160727091654.P1485@besplex.bde.org> References: <201607262011.u6QKBTDp043256@repo.freebsd.org> <20160727091654.P1485@besplex.bde.org> From: Ed Schouten Date: Thu, 28 Jul 2016 15:02:56 +0200 Message-ID: Subject: Re: svn commit: r303342 - in head: include lib/libc/stdlib To: Bruce Evans Cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 13:02:58 -0000 Hi Bruce, 2016-07-27 2:44 GMT+02:00 Bruce Evans : > This might work here since the type is unsigned, but it wouldn't work to > change from int to long. Yes. That's a pretty good remark. What makes this pretty safe in this case is that srandom() discard the top bits anyway. The first thing it does is cast the argument to an uint32_t, so even if we didn't properly zero/size extend this, it wouldn't end up being used. Best regards, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717