config: don't multiply in parse_unit_factor()
commit664178e8e23fbd6d79b02ea51374015023c02102
authorRené Scharfe <l.s.r@web.de>
Sat, 22 Jun 2019 10:03:36 +0000 (22 12:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Jun 2019 19:34:19 +0000 (24 12:34 -0700)
tree5a3271be87bb31c92ebd97af3e144f3a1d1615de
parent3fb72c7b4d90fb7f95ca60f448c7739cca6c1846
config: don't multiply in parse_unit_factor()

parse_unit_factor() multiplies the number that is passed to it with the
value of a recognized unit factor (K, M or G for 2^10, 2^20 and 2^30,
respectively).  All callers pass in 1 as a number, though, which allows
them to check the actual multiplication for overflow before they are
doing it themselves.

Ignore the passed in number and don't multiply, as this feature of
parse_unit_factor() is not used anymore.  Rename the output parameter to
reflect that it's not about the end result anymore, but just about the
unit factor.

Suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c