mirror of
https://gitlab.com/procps-ng/procps.git
synced 2024-11-23 18:14:15 +08:00
free: Parse -s option correctly.
If the -s option was the first option on the command line, free would report seconds argument failed. This only appeared on the Debian free, not the one in git. Closer examination revealed that if a valid float string is given to strtof() it doesn't set errno to 0, but just leaves it alone. As we are explicitly testing errno for overflows, this means the previous errno change is picked up here. The simple answer is to set errno to 0 before calling strtof(). References: https://bugs.debian/org/733758 https://enc.com.au/2015/08/08/be-careful-with-errno/
This commit is contained in:
parent
1f67b7dc71
commit
fd007d6d1d
1
NEWS
1
NEWS
@ -12,6 +12,7 @@ procps-ng-NEXT
|
||||
* top once again will fully honor a saved rcfile,
|
||||
without requiring --disable-modern-top. Debian #762928, #762947
|
||||
* vmstat: Not crash if partition appears before disk Debian #736628
|
||||
* free: -s without -c works Debian #733758
|
||||
|
||||
procps-ng-3.3.10
|
||||
----------------
|
||||
|
Loading…
Reference in New Issue
Block a user