Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Apr 2011 00:31:07 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/lib/libutil humanize_number.c
Message-ID:  <201104220031.p3M0VExG000111@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
delphij     2011-04-22 00:31:07 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_8)
    lib/libutil          humanize_number.c 
  Log:
  SVN rev 220933 on 2011-04-22 00:31:07Z by delphij
  
  MFC r219939:
  
  humanize_number(3) multiply the input number by 100, which could cause an
  integer overflow when the input is very large (for example, 100 Pi would
  become about 10 Ei which exceeded signed int64_t).
  
  Solve this issue by splitting the division into two parts and avoid the
  multiplication.
  
  PR:             bin/146205
  Reviewed by:    arundel
  
  Revision  Changes    Path
  1.4.2.2   +24 -16    src/lib/libutil/humanize_number.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104220031.p3M0VExG000111>