summaryrefslogtreecommitdiffstats
path: root/lib/libutil/fmt_scaled.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix overly-conservative overflow checks on mulitplications and add checksdtucker2017-03-161-3/+11
| | | | | on additions. This allows scan_scaled to work up to +/-LLONG_MAX (LLONG_MIN will still be flagged as a range error). ok millert@
* Collapse underflow and overflow checks into a single block.dtucker2017-03-151-7/+4
| | | | ok djm@ millert@
* Catch integer underflow in scan_scaled reported by Nicolas Iooss.dtucker2017-03-151-1/+6
| | | | ok deraadt@ djm@
* fix signed integer overflow in scan_scaled. Found by Nicolas Ioossdjm2017-03-111-1/+14
| | | | using AFL against ssh_config. ok deraadt@ millert@
* fairly simple unsigned char casts for ctypederaadt2013-11-291-5/+6
| | | | ok krw
* make scan_scaled set errno to EINVAL rather than ERANGE if it encountershalex2012-11-121-2/+4
| | | | | | an invalid multiplier, like the man page says it should "looks sensible" deraadt@, ok ian@
* use llabs instead of the home-grown version; and some comment changesmartynas2009-06-201-4/+4
| | | | ok ian@, millert@
* remove some bogus *p from charles longeautedu2007-03-201-4/+4
| | | | ok deraadt millert
* library routines should not be checking for NULL pointers passed in,deraadt2005-10-191-11/+1
| | | | | | and then setting errno to EFAULT. that is balony programming! they should keep stumbling along to purposely create a crash, so that the programmer stops doing that kind of stupid crap. ok otto
* scrape $Id$ tags.espie2005-08-021-5/+1
| | | | okay deraadt@, millert@, krw@
* Fix rounding of fractionless numbers. ok tom@ miod@otto2005-03-091-4/+10
|
* Fix sizing of fraction. ok tom@ deraadt@otto2005-03-081-9/+4
|
* fix 1099512676352 -> 2.0T; ok miod@otto2004-09-161-3/+3
|
* knf; otto okderaadt2004-05-281-3/+4
|
* o Do not drop unit when printing -100otto2003-12-271-5/+8
| | | | | | | o Round negative numbers correctly o Do not print fractional valus for byte values ok ian@ henning@
* New: fmt_scaled() and scan_scaled() convert to and from "human readable"ian2003-05-151-0/+277
or scaled numbers. fmt_scaled, and the format, based on Ken Stailey's code for "df -h"; scan_scaled is new. Significantly commented on and reworked by pjanzen@; other comments from millert@. OK pjanzen@.